Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Main plugin;
- private Entity realEntity;
- private Player p;
- public Exploder(Main instance) {
- this.plugin = instance;
- }
- @EventHandler
- public void SnowballLightning(ProjectileHitEvent e) {
- Entity entity = e.getEntity();
- Projectile proj = (Projectile)entity;
- Entity shooter = proj.getShooter();
- if ((entity.getType() == EntityType.EGG) &&
- (shooter.getType() == EntityType.PLAYER)) {
- final Player p = (Player)shooter;
- int radius = 4;
- List entitylist = entity.getNearbyEntities(radius, radius, radius);
- for (int i = 0; i < entitylist.size(); i++) {
- realEntity = (Entity)entitylist.get(i);
- }
- LivingEntity newEnt = (LivingEntity)realEntity;
- double posX = proj.getLocation().getX();
- double posY = proj.getLocation().getY();
- double posZ = proj.getLocation().getZ();
- proj.getWorld().createExplosion(posX, posY, posZ, 4.0F, false, false);
- newEnt.damage(4);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement