Skip to content

Commit

Permalink
Add non-player targeting
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmeow committed Nov 30, 2019
1 parent da1ac6e commit 7842264
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import net.minecraft.block.state.IBlockState;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EnumCreatureAttribute;
import net.minecraft.entity.MoverType;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
Expand Down Expand Up @@ -49,6 +51,7 @@ protected void initEntityAI() {
this.tasks.addTask(2, new EntityAILookIdle(this));
this.targetTasks.addTask(0, new EntityAIHurtByTarget(this, false, new Class[0]));
this.targetTasks.addTask(1, new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, true));
this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityLiving>(this, EntityLiving.class, 0, true, true, (EntityLiving entity) -> !(entity instanceof EntityZotzpyre) && entity.getCreatureAttribute() != EnumCreatureAttribute.UNDEAD));
}

protected PathNavigate createNavigator(World worldIn) {
Expand Down

0 comments on commit 7842264

Please sign in to comment.