1

I want to make a "lightning rod" in Minecraft. I'll have a stick or something that when right-clicked, it summons lightning one block in front of player.

How can I detect a player right-clicking with a specific item in hand?

6
  • 6
    Related/possible duplicate
    – Nick B.
    Aug 8, 2015 at 1:52
  • 1
    The answer depends on what the "something" you're right clicking with is. There are easy ways to detect placing down blocks, casting fishing rods, blocking with swords, etc.. Harder to detect if you're using a blaze rod or item that doesn't already do something special with right clicked, but still possible.
    – SirBenet
    Aug 8, 2015 at 12:16
  • I want to use a stick, but now that you say it, a sword would be great! Aug 8, 2015 at 13:02
  • @CollinFitch Also, does this need to work in 1.8.8 or are you using the snapshots? (Makes a difference, but not a huge one)
    – SirBenet
    Aug 8, 2015 at 13:49
  • /testfor isn't for events, it detects entity presence. Aug 13, 2015 at 20:33

1 Answer 1

0

Well..you could use a fishing rod,and test for the entity when you right click the rod. The fishing rod bobber is an entity which gets summoned when you right click the fishing rod. The bobber's entity name is "unknown". So just /testfor @e[type=Unknown] Normal items can't be tested for right click because they don't do anything. The only way to do it,it's to do it with plugins

3
  • How exactly can s/he "use a fishing rod,and test for the entity when you right click the rod"?
    – ave
    Nov 29, 2015 at 10:53
  • Well,the fishing rod bobber is an entity which gets summoned when you right click the fishing rod. The bobber's entity name is "unknown". So just /testfor @e[type=Unknown]
    – Kez
    Nov 29, 2015 at 10:57
  • 1
    adding that to the answer can be a better choice
    – ave
    Nov 29, 2015 at 11:27

Not the answer you're looking for? Browse other questions tagged .