PlayerInteract and Action and RightClick

Discussion in 'Plugin Development' started by Zero9195, Mar 25, 2011.

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

    Zero9195

    Hey Guys,
    I'm back again to update my plugin, but unfortunatly I'm too stupid to do so. Can someone explain to me how I can trigger a BlockRightClick? If someone rightclikcs the block something will happen. Just don't know how to do it. Thanks for your help.
    Zero9195
     
  2. Offline

    Edward Hand

    Yeah. The Bukkit team decided they wanted to make life hell for developers some more.

    All right click events are now grouped under PLAYER_INTERACT

    This is a Player event, so inside a PlayerListener you need something like this:
    Code:
    onPlayerInteract(PlayerInteractEvent event)
    {
       if(event.getAction()!=Action.RIGHT_CLICK_BLOCK)
        return;
       //other stuff
    }
    EDIT: fixed code - thanks Sosser
     
  3. Offline

    Zero9195

    Yeah I recognised that too xD
    Thanks for fast elp, work now ;)
     
  4. Offline

    Sosser

    Exactly what is the e?
    In
    Code:
    e.getAction()!=Action.RIGHT_CLICK_BLOCK
     
  5. Offline

    Edward Hand

    oops sorry. change to 'event'.
     
  6. Offline

    Sosser

    Ah, thanks! That explains alot :)
     
Thread Status:
Not open for further replies.

Share This Page