Minecraft – Fingerprint scanner in minecraft

minecraft-commandsminecraft-java-edition

I want to make a fingerprint scanner in minecraft that lets players through a door. I want this to be realistic, so that the player actually has do to something with their hand in order to be let in. I don’t want to stray too far from the point, but this is (in a nutshell) how it works:

  1. The player rotates glass in an item frame.
  2. A command block system detects whether the player should
    be allowed in and, supposing the player is allowed in;
  3. The glass in the item frame turns green.

I have got part 2, but I need help with part one and three, so, in conclusion:

  1. How do I use /testfor to detect glass rotating in an item
    frame and;
  2. How do I /setblock green_stained_glass_pane?

Best Answer

For 1, you can either use a /data get entity @e[type=item_frame,limit=1] ItemRotation or a comparator.

For 3, you can simply just use /kill @e [type=item_frame,limit=1] and then /summon ItemFrame <x> <y> <z> {Direction:facingb,Item:{green_stained_glass_pane}} replacing "facing" (leave the letter b as it is) with the way it is facing (0=south, 1=west, 2=north, and 3=east.)

Also, item frames count as entities, not as blocks.