Player Velocity Based on Direction

Discussion in 'Plugin Development' started by iWareWolf, Mar 24, 2014.

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

    iWareWolf

    I was wondering how I would make it set the player's velocity to three blocks up and two blocks to the direction the player is looking at.

    [​IMG]

    Something like this ^ Basically so the player can drop onto something.
     
  2. Offline

    sirantony

    i don't know if this will work (but it should). You can try.:)
    Code:java
    1. Player p;
    2. Integer force = 2;
    3. Vector v = p.getLocation().add(0,2,0).getDirection();
    4. p.setVelocity(v.multiply(2));
     
Thread Status:
Not open for further replies.

Share This Page