Solved How To Launch Snowballs

Discussion in 'Plugin Development' started by zachoooo, Oct 23, 2012.

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

    zachoooo

    I am trying to make a thing that shoots snowballs. How can I convert the look direction of the player into a useable vector to fire the snowball?
    Solved using getLocation().getDirection();

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
  2. Offline

    Woobie

    -_-
    Code:
    Player p = e.getPlayer();
    Snowball ball = p.getWorld().spawn(p.getEyeLocation(), Snowball.class);
    snowball.setShooter(p);
    ball.setVelocity(p.getLocation().getDirection().multiply(1.5));
    Why cant I be helpful? :'(
     
    Skyost and zachoooo like this.
  3. Offline

    zachoooo

    Why thank you, thats even better than my solution
     
  4. Offline

    Woobie

    PARTAAAY!!
     
    Skyost and bobacadodl like this.
Thread Status:
Not open for further replies.

Share This Page