AOE Push Spell

Discussion in 'Plugin Development' started by AstramG, Jul 21, 2013.

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

    AstramG

    How could I possibly make an AOE spell that pushes players back from the caster? The caster will use the spell then every player within a 6 blocks will be pushed away from the caster. I know it uses vectors and I'm not too skilled with them. Thanks in advance!
     
  2. Offline

    chasechocolate

    Loop through nearby entities, and use entity.setVelocity(entity.getLocation().toVector().subtract(p.getLocation().toVector())).
     
    AstramG likes this.
  3. Offline

    AstramG

    Thanks :)
     
  4. Offline

    chasechocolate

    I forgot to mention this, but you might want to normalize the vector.
     
  5. Offline

    AstramG

    How would I normalize it?
     
  6. Offline

    Zarkopafilis

    .normalize();
     
  7. Offline

    AstramG

    Oh, what does it do?
     
  8. Offline

    Zarkopafilis

    I dont know. Since it works for me , add it after each .toVector() ...
    Basically you can see what it does from googling it or from its title.Makes stuff normal?(and fixes issues...)
     
Thread Status:
Not open for further replies.

Share This Page