keycard door
so I want to add a feature to my prison map where when a player holds a "keycard" (an item with custom model data) when they walk within a specific radius of a door it opens. I tried doing this by replacing the specific coords 2 blocks under the door with a redstone torch when a player has a specific block 2 blocks under him but I just cant get it to work properly here are the commands I used: (repeating command block: execute if items entity @p weapon.offhand minecraft:rib_armor_trim_smithing_template run tag @p add verified) (repeating command block: execute at @p[tag=verified] if block ~ ~-2 ~ minecraft:lime_glazed_terracotta run setblock 24 -1 8 minecraft:redstone_torch) (repeating command block: execute if block ~ ~-2 ~ minecraft:red_glazed_terracotta run setblock 24 -1 8 air(chain command block connected: tag @p[tag=verified] remove verified) it is a signleplayer map btw so using @p works well for me