Solved Flying problem

Discussion in 'Plugin Development' started by RainoBoy97, Aug 1, 2013.

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

    RainoBoy97

    Hello again!

    Just ran across a small problem, that I need fixed. I try to set a player so they can fly, but nothing works.

    Code:
    public static void preGame(Player player) {
    PlayerUtil.clearPlayer(player);
    player.setAllowFlight(true);
    player.setFlying(true);
    }
     
    public static void clearPlayer(Player player) {
    player.setHealth(20D);
    player.setFoodLevel(20);
    player.setFireTicks(0);
    player.setAllowFlight(false);
    player.setFlying(false);
    player.setExhaustion(0);
    player.setSaturation(12.5F);
    for(PotionEffect ef : player.getActivePotionEffects()) {
    player.removePotionEffect(ef.getType());
    }
    }
    
    I have also tried to set "allow-flight" in the server.properties to true, but that didnt help :(

    Thanks.
     
  2. Offline

    RainoBoy97

    Bump :3
     
  3. Offline

    foodyling

    RainoBoy97 Are you sure the methods are even being called? The code looks perfectly fine to me.
     
  4. Offline

    RainoBoy97

    I think I found a solution!
     
Thread Status:
Not open for further replies.

Share This Page