How to fix sneak listener.

Discussion in 'Plugin Development' started by euller12, Aug 9, 2013.

?

How to fix sneak listener.

  1. Can help me.

    0 vote(s)
    0.0%
  2. Knows how to do it.

    0 vote(s)
    0.0%
Thread Status:
Not open for further replies.
  1. Offline

    euller12

    Can someone help fix my code to make it work.
    Code:java
    1. public void onPlayerToggleSneak(PlayerToggleSneakEvent event) {
    2. Player player = event.getPlayer();
    3.  
    4. if(player.isSneaking()) {
    5. player.openInventory(inv);
    6. }
    7. }


    It wont do anything when I shift.
     
  2. Offline

    Xx_LeetGamer_xX

    Are you adding "@EventHandler" above the method declaration?
    Are you registering this event?
     
  3. Offline

    euller12

  4. Offline

    Xx_LeetGamer_xX

    At the very start of that method add a broadcast to make sure its being ran.
     
  5. Offline

    euller12

    I fixed it thanks for your help!
     
Thread Status:
Not open for further replies.

Share This Page