Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SheepCommander/1745549b0dfcd5c8bc9cc6c6a260a02e to your computer and use it in GitHub Desktop.
Save SheepCommander/1745549b0dfcd5c8bc9cc6c6a260a02e to your computer and use it in GitHub Desktop.
Most efficient way to detect right click

Right Click Detection 1.8.9 [Most efficient] Looping:

# Summons
execute if entity @e run execute as @e run execute at @e run execute as @a run execute at @s run execute anchored eyes run execute positioned ^ ^ ^ run summon minecart ^ ^ ^ {NoGravity:1b,Glowing:0b,Invulnerable:0b,CustomNameVisible:0b,CustomDisplayTile:1b,DisplayOffset:0,Motion:[0.0,0.0,0.0],Rotation:[0.0F,0.0F],Tags:["UltimateOmegaEfficientRightClickDetector"],CustomName:'{"text":"Ultimate omega efficient right click detector","font":"minecraft:default","color":"dark_purple","bold":true,"italic":true,"underlined":true,"strikethrough":true,"obfuscated":true}',DisplayState:{Name:"minecraft:air"}}
# Detects
execute if entity @e run execute as @e run execute at @e run execute as @e[type=minecart] run execute at @s run execute if entity @s run execute run execute if entity @a as @a at @a run execute as @s[nbt={rootVehicle:{id:"minecraft:minecart",tag:{NoGravity:1b,Glowing:0b,Invulnerable:0b,CustomNameVisible:0b,CustomDisplayTile:1b,DisplayOffset:0,Motion:[0.0,0.0,0.0],Rotation:[0.0F,0.0F],Tags:["UltimateOmegaEfficientRightClickDetector"],CustomName:'{"text":"Ultimate omega efficient right click detector","font":"minecraft:default","color":"dark_purple","bold":true,"italic":true,"underlined":true,"strikethrough":true,"obfuscated":true}',DisplayState:{Name:"minecraft:air"}}}}] run function namespace:right_clicked
# Kills
kill @e[type=minecart,nbt={NoGravity:1b,Glowing:0b,Invulnerable:0b,CustomNameVisible:0b,CustomDisplayTile:1b,DisplayOffset:0,Motion:[0.0,0.0,0.0],Rotation:[0.0F,0.0F],Tags:["UltimateOmegaEfficientRightClickDetector"],CustomName:'{"text":"Ultimate omega efficient right click detector","font":"minecraft:default","color":"dark_purple","bold":true,"italic":true,"underlined":true,"strikethrough":true,"obfuscated":true}',DisplayState:{Name:"minecraft:air"}}]

Will work but is really bad. Actually JE 1.13+ gist.github.com/SheepCommander/1745549b0dfcd5c8bc9cc6c6a260a02e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment