Right click in air

Discussion in 'Plugin Development' started by imotionzz, May 29, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    imotionzz

    Hello,

    I've got a plugin with iconmenu. But I want if you click with an emerald right in the air it opens the
    iconmenu.
    Maybe its a noob question but I started java 3 days ago :p.

    This is my main class: http://pastebin.com/smuMg92F
     
  2. Offline

    chasechocolate

  3. Offline

    Jogy34

    Well... you may want to learn more java first if you only started a few days ago. But anyways here's a good plugin tutorial: http://wiki.bukkit.org/Plugin_Tutorial You want to look for the event listeners section then use a PlayerInteractEvent to get when a player right clicks.

    EDIT: ninja'd by chasechocolate
     
  4. Code:
      @EventHandler
      public void onRightClick(PlayerInteractEvent event){
    
          Player player = event.getPlayer();
          if(event.getAction().equals(Action.RIGHT_CLICK_AIR) && player.getItemInHand().getType() == Material.EMERALD){
    // your stuff here
     
Thread Status:
Not open for further replies.

Share This Page