Minecraft – How to detect minecraft item (any fern) in correct item frame and in correct rotation (1.13)

minecraft-commandsminecraft-java-edition

I would like some help in the use of command block on my adventure map. I would like to know the "execute if" command needed to detect if a fern placed at a item frame at a specific position is pointing rightways. And if it is detected emits a redstone signal

Best Answer

Command:

/execute if entity @e[type=minecraft:item_frame,nbt={ItemRotation:0b,Item:{id:"minecraft:fern"}}] run say hi

If you want redstone output then put this command in repeating command block and place a comparator There are 8 possible rotations