3

I want to make a 7x7 jigsaw puzzle. I want to know how I can use /execute (or a different command) to check for a filled map named Map#26 in an item frame at coordinates (-26, 74 -100).

Edit: Okay so, I changed locations.

execute if entity @e[type=minecraft:item_frame,nbt={Item:{id:"minecraft:filled_map"}}] run say jeff

The command above executes if there is a filled map in an item frame anywhere. Once there is a map in an item frame it will say jeff.

What I am trying to figure out is a command that executes if there is a named filled map in an item frame at a specific item frame. Once there is a map in that item frame the command will say joe."

For an example

execute if there is an item frame with a filled map named Map#24 at -26, 74, -100 run say joe.

Edit: Some success has been made with this command.

execute if entity @e[type=minecraft:item_frame,nbt={Item:{id:"minecraft:filled_map",tag:{display:{Name:'{"text":"Map#24"}'}}}}] run say jeff

The command above says jeff if there is a map named Map#24 in an item frame. The thing is, that item frame can be anywhere. So far, the only what I have tried is this command:

execute if entity @e[x=-39.5,y=63.5,z=21.96875,type=minecraft:item_frame,nbt={Item:{id:"minecraft:filled_map",tag:{display:{Name:'{"text":"Map#24"}'}}}}] run say jeff

But this command didn't work for a specific location. Please help, thank you.

2

NBT is your best friend here.

Detecting item frame position

Don’t try using the target selector arguments x, y, and z. These could have decimal parts and will definitely not work.

Instead, use the NBT tags TileX, TileY, and TileZ. These represent a block location and are integers.

/execute if entity @e[type=item_frame,nbt={TileX:12,TileY:23,TileZ:34}] run say Item frame in correct position.
| improve this answer | |
  • 1
    Thank you so much, this really helped me. For anyone wondering what the final command looks like, here you go: execute if entity @e[type=minecraft:item_frame,nbt={TileY:63,TileX:-40,TileZ:21,Item:{id:"minecraft:filled_map",tag:{display:{Name:'{"text":"Map#24"}'}}}}] run say jeff – Firal Aug 31 at 2:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.