Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

teleport to fly

Comments in 'Plugin Development' started by udwarf, May 22, 2016.

  1. udwarf
    Offline

    udwarf Active Member

    Joined:
    Apr 17, 2016
    Posts:
    61
    Minecraft User:
    1Zaza
    Hi, guys!

    How to force player to be in fly-state right after teleportation?
    My player in creative mode and tp destination point is in the air
    I want that player will hang in the air, but now he is just falling down
    PHP:
    $player->setGamemode(1);
    $player->setAllowFlight(true);
    $player->teleport($pos$yawn);
    Please help!
  2. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
    you can't .
    btw, setGamemode(1) already allows flight .
    Last edited: May 23, 2016
  3. PaulchenHD
    Offline

    PaulchenHD Active Member

    Joined:
    Jan 17, 2016
    Posts:
    111
    Minecraft User:
    Paulchen_HD
    setAllowFlight allowed Players to fly like creative he have to click the jump button o:
  4. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
    you can set the invisible bedrock under the player to avoid fall .
  5. PaulchenHD
    Offline

    PaulchenHD Active Member

    Joined:
    Jan 17, 2016
    Posts:
    111
    Minecraft User:
    Paulchen_HD
    ouh yeah he can ;)
    Block-Id: 95
  6. udwarf
    Offline

    udwarf Active Member

    Joined:
    Apr 17, 2016
    Posts:
    61
    Minecraft User:
    1Zaza
    Yep, That was my first approach. I patched a server by adding "barrier" block (id 95). And that somehow works.
    I would like to make player to be able "fly" above some arena.
    I was trying to always put "barrier" block under the player while he run, but player still often fall down (I think that happens in case of even minimal lags)
    And when I fill the entire arena field with barriers than I face with performance issue because of weird transparency behavior of "barriers".
    I want get rid of that barriers by making players fly and controlling theirs fly height
  7. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Hmm, how about aborting PlayerMoveEvent if y goes down?
  8. udwarf
    Offline

    udwarf Active Member

    Joined:
    Apr 17, 2016
    Posts:
    61
    Minecraft User:
    1Zaza
    I think, the player will fall anyway. Or he will twitch up and down
  9. udwarf
    Offline

    udwarf Active Member

    Joined:
    Apr 17, 2016
    Posts:
    61
    Minecraft User:
    1Zaza
    Yep.
    As I thought
  10. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Ok, we have to make the client think it is flying

Share This Page

Advertisement