final int range = 6;
final int manaToUse = getManaCost();
if(supertile.getWorldObj().getTotalWorldTime() % 5 == 0) {
List<EntityLivingBase> entities = supertile.getWorldObj().getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord, supertile.zCoord - range, supertile.xCoord + range, supertile.yCoord + 1, supertile.zCoord + range));
IEntitySelector selector = getSelector();
for(EntityLivingBase entity : entities) {
if(!selector.isEntityApplicable(entity))
continue;
if(entity.hurtTime == 0 && mana >= manaToUse) {
entity.attackEntityFrom(DamageSource.magic, 4);
mana -= manaToUse;