How do I detect right clicks with commands? [duplicate]

How do I detect right clicks with commands? [duplicate] - Chalkboard with I See You I Hear You titles

As the title says, I would like detecting right clicks. I have already tried spawning a slime that teleports to the player's head but I don't know how I would build the syntax. How can I do this?



Best Answer

Well, you could use the scoreboard objectives for stat.useItem. You would have to have a test for command block and objective for every item that the player would use to left click, however.




Pictures about "How do I detect right clicks with commands? [duplicate]"

How do I detect right clicks with commands? [duplicate] - Crop faceless person showing paper with i can t breath inscription during Black Lives Matter movement demonstration
How do I detect right clicks with commands? [duplicate] - From above of face mask on blackboard with I Cant Breathe title during COVID 19 pandemic
How do I detect right clicks with commands? [duplicate] - Free stock photo of acab, activism, adult





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: Brett Sayles, Kelly, Brett Sayles, RODNAE Productions