Right click detection on a block (No item on hand) Minecraft
//ads -- adsterra.com -- native banner
?>
How can I modify this code to detect a right click when right-clicking a specific block only, without any item in a player hand? This is not like others, for I am not using an Item or I am not right-clicking any object. Just a specific one like a torch, to act like a button. I can use scorebords with this though.
/scoreboard players set @e[type=ArmorStand,name=Activated] action 1 {Equipment:[{},{},{},{},{}]}
/scoreboard players set @e[type=ArmorStand,name=Activated] action 0 {Equipment:[{id:"minecraft:carpet"},{},{},{},{}]}
/execute @e[name=Activated,score_action_min=1] ~ ~ ~ /setblock XYZ-Coordinates redstone_block
/execute @e[name=Activated,score_action=0] ~ ~ ~ /setblock Same XYZ-Coordinates air
Pictures about "Right click detection on a block (No item on hand) Minecraft"



Right Click Detection in Vanilla Minecraft [1.16 Command Blocks]
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: RODNAE Productions, Joshua Miranda, Joshua Miranda, Joshua Miranda
