How to summon an item frame facing a specific direction in Minecraft?

I am working on a map and I need to summon an item frame in a specific place. I'm using the command:

/summon item_frame -1242 58 219

but "it is on the ground" and I need it to face north.


Solution 1:

You need to summon the entity with custom NBT: /summon minecraft:item_frame -1242 58 219 {Facing:2}

The Facing part is what is added. The default number is 1, which is facing up. 2 is facing north, which you are looking for. If you try different numbers, you will find that it will face different directions.