@Override protected void applyAttackEffectsToEntity(World world, EntityLiving el) { double x = el.posX; double y = el.posY; double z = el.posZ; el.clearActivePotions(); for (int h = 0; h < 5 && !(el instanceof EntityPlayer); h++) { ItemStack held = el.getCurrentItemOrArmor(h); el.setCurrentItemOrArmor(h, null); if (!world.isRemote && held != null) { EntityItem ei = new EntityItem(world, x, y, z, held); ReikaEntityHelper.addRandomDirVelocity(ei, 0.2); ei.delayBeforeCanPickup = 300; world.spawnEntityInWorld(ei); } } // ReikaChatHelper.writeEntity(world, el); if (el instanceof EntityDragon) { ((EntityDragon) el) .attackEntityFromPart( ((EntityDragon) el).dragonPartHead, DamageSource.setExplosionSource(new Explosion(worldObj, this, x, y, z, 20)), this.getAttackDamage()); if (el.isDead || el.getHealth() <= 0) { RotaryAchievements.RAILDRAGON.triggerAchievement(gun.getPlacer()); } } else el.attackEntityFrom(DamageSource.generic, this.getAttackDamage()); if (el instanceof EntityPlayer) { if (el.isDead || el.getHealth() <= 0) RotaryAchievements.RAILKILLED.triggerAchievement((EntityPlayer) el); } el.motionX = motionX * power / 15F; el.motionY = motionY * power / 15F; el.motionZ = motionZ * power / 15F; }