event.setCancelled(true); not working

Discussion in 'Plugin Development' started by Danza, Mar 22, 2011.

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

    Danza

    Hi.
    Bukkit 531 and 559 i try they both. and cant understand why, but anjosecurity and other plugins(including my) where using event.setCancelled(true); is not working(without errors).

    i was tryed:
    Code:
    @Override
        public void onPlayerMove(PlayerMoveEvent event) {
            System.out.println("test");
            event.setCancelled(true);
    
        }
    in console i see test but event not cancel

    the same with onBlockPlace onBlockBreak and maybe other... and i cant remeber when it happens...
     
  2. Offline

    Sammy

    Didn't you forgot to register the event in OnEnable ?

    EDIT: I forgot, OnMove doesn't work like that, I think its a lag problem, you need to do a hackish solution... teleport the player back to the original place
     
  3. Offline

    Danza

    thank you. player.teleport works for me.
     
Thread Status:
Not open for further replies.

Share This Page