net.minecraft.entity.ai.EntityAIAttackOnCollide Java Examples
The following examples show how to use
net.minecraft.entity.ai.EntityAIAttackOnCollide.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EntityEndermite.java From Et-Futurum with The Unlicense | 5 votes |
public EntityEndermite(World world) { super(world); sorter = new EntityAINearestAttackableTarget.Sorter(this); experienceValue = 3; setSize(0.4F, 0.3F); tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); tasks.addTask(3, new EntityAIWander(this, 1.0D)); tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(8, new EntityAILookIdle(this)); targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 10, true)); }
Example #2
Source File: EntityClayGolem.java From Artifacts with MIT License | 5 votes |
public EntityClayGolem(World par1World) { super(par1World); //this.moveSpeed = 0.16F; /*this.setSize(1.4F, 2.9F); this.getNavigator().setAvoidsWater(true); this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, 0.288D, false)); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityZombie.class, 0.288D, true)); this.tasks.addTask(3, new EntityAIMoveTowardsRestriction(this, 0.16D)); this.tasks.addTask(4, new EntityAIWander(this, 0.16D)); this.tasks.addTask(5, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(6, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityZombie.class, 0, true)); //this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true, true, IMob.mobSelector)); //this.targetTasks.addTask(3, new EntityAINearestAttackableTarget(this, EntityZombie.class, 0, false, true, IMob.mobSelector));*/ this.getNavigator().setAvoidsWater(true); this.tasks.addTask(2, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false)); this.tasks.addTask(3, new EntityAIAttackOnCollide(this, EntityVillager.class, 1.0D, true)); this.tasks.addTask(4, new EntityAIMoveTowardsRestriction(this, 1.0D)); this.tasks.addTask(5, new EntityAIMoveThroughVillage(this, 1.0D, false)); this.tasks.addTask(6, new EntityAIWander(this, 1.0D)); this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(7, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true)); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, 0, false)); }