[SOLVED]throwing a player in the air, or just adding to the players current height?

Discussion in 'Plugin Development' started by jeffadkins51, Jul 21, 2011.

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

    jeffadkins51

    Is there anyway to do this? To add maybe like 3 or 5 blocks to the players height by right clicking?
     
  2. Offline

    bleachisback

    if you want to throw them straight up, you can do this:
    Code:
    player.setVelocity(player.getVelocity.setY(player.getVelocity.getY()+2))
     
  3. Offline

    nisovin

    You can use player.teleport() to move a player, or player.setVelocity() to set their velocity (a velocity with only a positive Y will send them into the air).
     
  4. Offline

    jeffadkins51

    Is there anyway to direct it though? In which way there aiming towards?
     
  5. Offline

    nisovin

    Try player.setVelocity(player.getLocation().getDirection().multiply(2));
     
  6. Offline

    jeffadkins51

    I get errors using that code.

    Got it working

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 17, 2016
Thread Status:
Not open for further replies.

Share This Page