SpaceEmotion

The fireball bug

Dec 5th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. // p is the player
  2.  
  3. // First example using launchProjectile
  4. // Result: Explodes at player location
  5. p.launchProjectile(SmallFireball.class);
  6.  
  7. // Second example using world-spawn
  8. // Result: flickers for a second, then disappears until it hit something
  9. final Vector direction = p.getEyeLocation().getDirection().multiply(1);
  10. final SmallFireball fireball = p.getWorld().spawn(p.getEyeLocation().add(direction.getX(), direction.getY(), direction.getZ()), SmallFireball.class);
  11. fireball.setShooter(p);
Advertisement
Add Comment
Please, Sign In to add comment