Solved Player Knockback

Discussion in 'Plugin Development' started by Tacola, Nov 5, 2012.

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

    Tacola

    Anyone have a snipet or a link that can show me an example of a simulated Knockback in code?
     
  2. Offline

    fireblast709

    Code:java
    1. player.setVelocity(new Vector(x,y,z))
     
  3. Offline

    CevinWa

    I have a simpeler one thats used in the guns in my plugin. That knockbacks in the players direction.


    Code:
    player.setVelocity(player.getLocation().getDirection().multiply(-1));
     
    
    This will cast the player backwards 1 block. in the direction he stands.
     
    Wruczek, DomIsAmazing27 and fromgate like this.
  4. Offline

    Tacola

    Thanks Guys, I used CevinWa's answer. It works great.
     
Thread Status:
Not open for further replies.

Share This Page