List<EntityPlayer> playersBelow = worldObj.getEntitiesWithinAABB(EntityPlayer.class, below);
for (EntityPlayer player : playersBelow) {
int dx = MathHelper.floor_double(player.posX);
int dy = MathHelper.floor_double(player.posY);
int dz = MathHelper.floor_double(player.posZ);
if (worldObj.canBlockSeeTheSky(dx, dy, dz)) {
player.attackEntityFrom(DamageSource.anvil, 3);
}
}
// also suck up mini ghasts
List<EntityTFMiniGhast> ghastsBelow = worldObj.getEntitiesWithinAABB(EntityTFMiniGhast.class, below);
for (EntityTFMiniGhast ghast : ghastsBelow) {
ghast.motionY += 1;
}
}
Change the
player.attackEntityFrom(DamageSource.anvil, 3);
to
player.attackEntityFrom(DamageSource.generic, 3);
this causes damage to player but does not break the helmets if does not have durability
in the UrGhast class
private void doTantrumDamageEffects() { // harm player below AxisAlignedBB below = this.boundingBox.getOffsetBoundingBox(0, -16, 0).expand(0, 16, 0);