Advertisement
Guest User

Untitled

a guest
Mar 29th, 2014
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. Main plugin;
  2. private Entity realEntity;
  3.  
  4. private Player p;
  5. public Exploder(Main instance) {
  6. this.plugin = instance;
  7. }
  8. @EventHandler
  9. public void SnowballLightning(ProjectileHitEvent e) {
  10.  
  11.  
  12. Entity entity = e.getEntity();
  13. Projectile proj = (Projectile)entity;
  14. Entity shooter = proj.getShooter();
  15.  
  16.  
  17. if ((entity.getType() == EntityType.EGG) &&
  18. (shooter.getType() == EntityType.PLAYER)) {
  19. final Player p = (Player)shooter;
  20.  
  21.  
  22. int radius = 4;
  23. List entitylist = entity.getNearbyEntities(radius, radius, radius);
  24.  
  25. for (int i = 0; i < entitylist.size(); i++) {
  26. realEntity = (Entity)entitylist.get(i);
  27. }
  28.  
  29.  
  30. LivingEntity newEnt = (LivingEntity)realEntity;
  31.  
  32. double posX = proj.getLocation().getX();
  33. double posY = proj.getLocation().getY();
  34. double posZ = proj.getLocation().getZ();
  35.  
  36. proj.getWorld().createExplosion(posX, posY, posZ, 4.0F, false, false);
  37. newEnt.damage(4);
  38.  
  39.  
  40.  
  41. }
  42. }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement