Disable fly mode on join.

Discussion in 'Plugin Development' started by WPM, Jul 29, 2015.

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

    WPM

    Is there a way to disable fly mode from essentials when a player joins and they are flying?
     
  2. Offline

    khave

    PlayerJoinEvent > player.setFlying(false);
     
  3. Offline

    WPM

    I have done that. Didnt do anything
     
  4. Offline

    SantaClawz69

    You can do an if statement to see if the player is flying and if he is then set his flying mode to false.
     
  5. I looked in the essentials command reference:
    You just need to remove this permission from the group and it should work
     
  6. Offline

    Jakeeeee

    In the PlayerJoinEvent it needs to be
    player.setAllowFlight(false);
    player.setFlying(false);
    both of them not just player.setAllowFlight(false);
     
  7. Offline

    MCMatters

    Its as simple as this:

     
  8. Offline

    george132222222

    Code:
    @EventHandler
    public void DisableFlight(PlayerJoinEvent e){
    Player p = e.getPlayer();
    p.setFlying(false);
    p.setAllowFlight(false);
    }
     
Thread Status:
Not open for further replies.

Share This Page