Creative Fly without Creative mode?

Discussion in 'Plugin Development' started by MG127, Feb 8, 2012.

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

    MG127

    the title sais all, i want someone to be able to fly like in creative mode without actualy being in creative mode. i just don't like magiccarpet and velocy-changing fly modes
     
  2. Offline

    Lydenia

    allow ur users to use a fly mod =) U also can say what group can use fly mod´s and who doesnt if u use NoCheat too =D
     
  3. Offline

    Simanova

  4. Offline

    ColeBergmann

    He is looking for just fly/ He doesn't want the player to get creative mode.
     
  5. Offline

    comp8nerd4u2

    Code:
    Player player = someRandomPlayer;
    player.setAllowFlight(true);
    That will allow a player to fly without being in creative mode. Good luck :)
     
  6. Set the players gamemode to creative but block them from placing/breaking/PvPing ? Or get them to install a fly mod.
     
  7. Offline

    fromgate

  8. Offline

    jamietech

    I believe the easiest way is simply to use
    which will tell the client that they are allowed to use fly mode and once this has been done the client will allow the player to double jump to start flying.
    (I'm not 100% sure on if this does tell the client this, gonna skim the code now, don't quote me on this yet)
     
  9. Offline

    ColeBergmann

    Essentials is what you are looking for. Use the newest version. Do /fly to enable and disable.
    - essentials.fly
    Hope I helped!
     
  10. Offline

    dsmyth1915

    Contrary to several people saying it, player.setAllowFlight() only sets it to the players creative allowed flight. I've already tried this :\
     
  11. Offline

    fromgate

    How about: player.setFlying(true);
    it not the same as setAllowFlight();
     
  12. Offline

    dsmyth1915

    It appears when I was doing it I did something wrong and gave up too quickly. I just checked essentials github on fly command and they appear to have a working fly command. Ad for setFlight() I don't believe it is valid. The correct method IS IN FACT: player.setAllowFlight(!player.getAllowFlight()) -simplest code.
     
  13. Offline

    nisovin

    The setAllowFlight(true) method turns on a player's ability to double jump to begin flying. The setFlying(true) method will actually turn on flight for that player. You can't do the second without doing the first before. This feature was only added in 1.2.4 (that's what makes the protocol incompatible with 1.2.3). So,

    Code:
    player.setAllowFlight(true);
    player.setFlying(true);
    
    Will make a player fly.
     
  14. Offline

    fromgate

    For toggle flight i'm using:
    p.setAllowFlight(!p.getAllowFlight());
    p.setFlying(p.getAllowFlight());
     
  15. Offline

    Mr Washington

    fromgate I can not get this to work. It gives me an internal server error and Null Pointers....
     
  16. Offline

    jamietech

    The only difference between this and what we already suggested is that if flying is set to true it will be set to false when this is called. If this is working for you what we suggested would have too.
     
Thread Status:
Not open for further replies.

Share This Page