Fireballs?

Discussion in 'Plugin Development' started by PandazNWafflez, May 2, 2012.

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

    PandazNWafflez

    I have been working on an addon module for a plugin named RageMod, more precisely a spells addon, and I want to add a fireball spell, is there any way to get a fireball to shoot from a player?
     
  2. Offline

    r0306

    Get the player's location and direction and then spawn the entity fireball where they are standing.
    Code:
    Location loc = player.getEyeLocation().toVector().add(player.getLocation().getDirection().multiply(2)).toLocation(player.getWorld(), player.getLocation().getYaw(), player.getLocation().getPitch());
    Fireball fireball = player.getWorld().spawn(loc, Fireball.class);
     
  3. Offline

    PandazNWafflez

    Thanks :)
     
  4. Offline

    r0306

    NP :p
     
  5. Offline

    Njol

    You could also use player.launchProjectile(Fireball.class). It returns a Fireball object which you can e.g. use to change it's speed.
     
  6. Offline

    Shinxs

    how do you change the speed then?
     
  7. Offline

    chasechocolate

    fireball.setVelocity(vector);
     
  8. Offline

    Shinxs

    and the vector is?
     
  9. Offline

    chasechocolate

  10. Offline

    Shinxs

  11. Offline

    chasechocolate

    fireball.setVelocity(fireball.getVelocity().multiply(2))?
     
  12. Offline

    Shinxs

    i did that allready but it was going at the same speed.
     
Thread Status:
Not open for further replies.

Share This Page