Skip to content

Instantly share code, notes, and snippets.

@SanAndreaP
Created September 8, 2012 09:05
Show Gist options
  • Save SanAndreaP/3672912 to your computer and use it in GitHub Desktop.
Save SanAndreaP/3672912 to your computer and use it in GitHub Desktop.
public void setOthersTarget() {
List<Entity> entities = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.expand(16D, 16D, 16D));
for(Entity entity : entities) {
if(entity instanceof EntityLiving && ((entity instanceof EntityMob) || (entity instanceof IMob))) {
if(((EntityLiving)entity).getAttackTarget() == null) ((EntityLiving)entity).setAttackTarget(this);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment