Set Flying Speed

Discussion in 'Plugin Development' started by leimekiller, Aug 16, 2013.

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

    leimekiller

    Hello,

    I am making an advanced fly plugin, but I don't know how to set the fly speed of the player. If anyone knwos this, please tell me.
     
  2. Offline

    dark navi

  3. Offline

    leimekiller

    dark navi I already tried to use setFlySpeed, but that didn't work for me...
     
  4. Offline

    PropGamer

    Try set then getFlySpeed.
     
  5. leimekiller Do you have Essentials installed on your server? (This can be the reason why it doesn't work)
     
  6. PropGamer
    That won't make any difference. getFlySpeed() only returns the current fly speed, nothing else.

    leimekiller
    setFlySpeed() has worked fine for me. Try giving them a speed potion effect if they're flying.
    Code:java
    1. @EventHandler
    2. public void onMove(PlayerMoveEvent e) {
    3. if (e.getPlayer().isFlying()) {
    4. e.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 20, 1));
    5. }
    6. }
     
Thread Status:
Not open for further replies.

Share This Page