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.

0

1 Answer 1

2

Update

As Minecraft commands have evolved, the performance impacts of the commands we run has become not insignificant. This answer before suggested to use the NBT tags TileX, TileY, and TileZ, but this is discouraged because NBT checks are heavy on performance.

The best way to detect an item frame in a certain position is to use the dx, dy, and dz selector arguments to create a 1×1×1 "selection cube" to find the item frame:

@e[type=item_frame,x=-40,y=63,z=21,dx=0,dy=0,dz=0]
1
  • 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
    Commented Aug 31, 2020 at 2:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .