Left Click

Discussion in 'Spigot Plugin Development' started by ItsWill, Jun 21, 2015.

  1. Hey! I'm creating a plugin that requires left click, so how would I do that? So. When a player left-click's a certain item it will open a GUI, but when it right-click's it will shoot.

  2. Yeah found that Action.LEFT_CLICK_AIR
    But how would implement this into my code?
  3. Code (Text):
    if (e.getAction() == Action.LEFT_CLICK_AIR) {
      // Stuff...
    You can also check the item with e.getItem()
  4. Thanks! I didn't need to be spoon-feed, just needed psuedo code. Anyways thanks!
  5. Didn't really know how to pseudo-code this, it's pretty basic, sorry.
    • Agree Agree x 2
  6. Sure, thanks though. Lol.