1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

SetAllowFlight not working?

Discussion in 'Development' started by LewBr, Jan 15, 2018.

  1. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    Hello, recently i have used that code:
    PHP:
                   $player->setFlying(false);
                  
    $player->setAllowFlight(false);
    But when runs that, the player goes to the floor with the setFlying method, but don't disable the flight mode by setAllowFlight, i have set false on that, but i can fly every time when i do that.. And i don't know why, i have tryed changing the gamemode of player but nothing is working, i set setAllowFLight(false) and i still with flight mode..
     
  2. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    Can I see ur full code
     
  3. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
  4. OnTheVerge

    OnTheVerge Spider Jockey

    Messages:
    46
    You need to put more detail or show your entire code because none of us know if u used either PlayerInteractEvent or a command...
     
    Last edited: Jan 15, 2018
  5. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
  6. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    There no details there only one code how I suppose to help him
     
  7. Kyd

    Kyd Zombie Pigman

    Messages:
    678
    GitHub:
    boi1216
    He already know about setAllowFlight().. Useless
     
  8. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    Maybe it’s pmmp problem than
     
  9. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    Given the details, that code is exactly what I'm currently using and it seems to work flawlessly except my code calls setAllowFlight() before setFlying() but that shouldn't be the problem.
     
  10. SkySeven

    SkySeven Baby Zombie

    Messages:
    145
    GitHub:
    SkySevenMC
    maybe allow-flight is off in server.properties
     
  11. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    That's an anti-cheat option, nothing to do with setAllowFlight/setFlying.
     
    OnTheVerge likes this.
  12. iCirgio

    iCirgio Slime

    Messages:
    92
    GitHub:
    lolnova
    Please send full code
     
  13. kenygamer

    kenygamer Banned Banned

    Messages:
    106
    GitHub:
    kenygamer
    Full code is required for us to determine with accuracy what is wrong.
     
    xXNiceAssassinlo YT and Muqsit like this.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.