teleport x blocks ahead?

Discussion in 'Plugin Development' started by TomShar, Nov 12, 2012.

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

    TomShar

    I'm trying to write a method that will teleport the player 5 blocks in the direction they are facing, that being up or to any angle (yes, including diagonals etc.)
     
  2. Offline

    LukeSFT

    use the pitch and the yaw of a player to calculate (I think with the help of pythagoras or sin/cos/tan) the Location.
     
  3. Offline

    Armadillo

    Code:
    //assume Player p
    p.setLocation.x = (p.getLocation.x + 5);
    I have not tried this out yet but it should (theoretically) work.
     
  4. Offline

    MineCraftMilk

    This is a good idea :)
     
Thread Status:
Not open for further replies.

Share This Page