Solved PlayerToggleSprintEvent Not Working

Discussion in 'Plugin Development' started by Pink__Slime, Jun 1, 2013.

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

    Pink__Slime

    So basically, if a player in the hashmap "playTank" toggles sprint, it will cancel it but it's not working.

    Code:java
    1. @EventHandler
    2. public void tankSprint(PlayerToggleSprintEvent event){
    3. Player player = event.getPlayer();
    4. if(Main.playTank.containsKey(player.getName())){
    5. event.setCancelled(true);
    6. }
    7. }


    Can someone tell me if I'm doing something wrong?
     
  2. Offline

    Ultimate_n00b

    I heard this didn't work anymore?
     
  3. Offline

    Pink__Slime

    Ultimate_n00b
    So does that mean I have to use PlayerMoveEvent, check if the player is sprinting and cancel it?
     
  4. Offline

    kreashenz

    Aren't packets used to set sprinting?
     
  5. Offline

    Pink__Slime

    kreashenz
    Where can I get a list of all the packets I can send the player? And I just thought I could use an event considering the was one on the JavaDocs.
     
  6. Offline

    kreashenz

    Pink__Slime I'm not entirely sure. I don't usually use packets.
     
  7. Offline

    Gravity

    player.setSprinting(false);
     
    Pink__Slime likes this.
Thread Status:
Not open for further replies.

Share This Page