PlayerMoveEvent on player

Discussion in 'Plugin Development' started by Aliano, Oct 24, 2020.

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

    Aliano

    Hello,

    when a player call this:

    Code:
        @EventHandler()
        private void onMove(PlayerMoveEvent e) {
            e.setCancelled(true);
        }
    }
    
    and from another class the player call:

    Code:
        @EventHandler()
        private void onMove(PlayerMoveEvent e) {
            e.setCancelled(false);
        }
    }
    
    it will used on all players. For Example: i logged in the the game. At this time is e.setCancelled(true) so i cant move. and after action (click on something) then e.setCancelled(false) now i can move normaly. Thats works without problems. But if someone else join the game, he have e.setCancelled(true) that is correct but i am also true so i cant move anymore till he click on action to set Cancelled(false)

    So the plugin dont works global instead of a player instance. i hope you understand what i mean and i hope for your help.
     
  2. Offline

    KarimAKL

    @Aliano The PlayerMoveEvent is called whenever ANY player moves, not just a specific player. You will have to check that yourself.
     
Thread Status:
Not open for further replies.

Share This Page