Slowing down a projectile

Discussion in 'Plugin Development' started by NonameSL, Jul 7, 2014.

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

    NonameSL

    How do I slow down a snowball? Is it possible?
    IDC if it is through valid code, potions, packets, or NMS. I just want a solution.

    Thanks in advance!
     
  2. Offline

    NathanWolf

    I believe in order to do this you have to spawn and shoot the projectile entity yourself (bypassing the Bukkit API) completely. I'd love to know if this is not true.

    The NMS "shoot" method takes a speed you can use if you go this route.
     
  3. Offline

    Necrodoom

  4. Offline

    TheHandfish

    ProjectileLaunchEvent: event.getEntity().setVelocity(event.getEntity().getVelocity().multiply(-2)); ?
     
  5. Offline

    fireblast709

    TheHandfish Vector multiplied by a negative number 'flips' the Vector :p. You would also run into issues with the gravity, causing your projectiles pretty much to fall from the sky.
     
  6. Offline

    NathanWolf

  7. Offline

    Necrodoom

    NathanWolf as above, set vector? If you mean speed by making the projectile travel slower without changing its path, I don't think that's possible without vector math.
     
  8. Offline

    NathanWolf


    I do mean that- as the OP requested. And it is possible :)
     
  9. Offline

    TheHandfish

    My mistake, multiplying by 0.5 would work. -2 would simply reverse the direction and send it twice as fast.
     
Thread Status:
Not open for further replies.

Share This Page