@SubscribeEvent public void onSkeletonUpdate(LivingEvent.LivingUpdateEvent event) { if (!(event.getEntityLiving() instanceof EntitySkeleton)) { return; } EntitySkeleton skeleton = (EntitySkeleton) event.getEntityLiving(); EntityAITasks tasks = skeleton.tasks; boolean containsOld = false; Iterator<EntityAITasks.EntityAITaskEntry> itr = tasks.taskEntries.iterator(); while (itr.hasNext()) { EntityAITasks.EntityAITaskEntry entry = itr.next(); if (entry.action instanceof EntityAIAttackRangedBow) { itr.remove(); } if (entry.action instanceof EntityAIAttackRanged) { containsOld = true; } } if (!containsOld) { tasks.addTask(4, new EntityAIAttackRanged(skeleton, 1.0D, 20, 15.0F)); } }
@Override protected void initEntityAI() { this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 60, 10.0F)); this.tasks.addTask(2, new EntityAIWander(this, 1.0D)); this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(3, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHallowitch.HurtByAggressor(this)); // this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); this.targetTasks.addTask(2, new EntityAIHallowitch.TargetAggressor(this)); // this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); }
protected void initEntityAI() { this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIRunAroundLikeCrazy(this, 1.2D)); this.tasks.addTask(2, new EntityAILlamaFollowCaravan(this, 2.0999999046325684D)); this.tasks.addTask(3, new EntityAIAttackRanged(this, 1.25D, 40, 20.0F)); this.tasks.addTask(3, new EntityAIPanic(this, 1.2D)); this.tasks.addTask(4, new EntityAIMate(this, 1.0D)); this.tasks.addTask(5, new EntityAIFollowParent(this, 1.0D)); this.tasks.addTask(6, new EntityAIWanderAvoidWater(this, 0.7D)); this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(8, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityLlama.AIHurtByTarget(this)); this.targetTasks.addTask(2, new EntityLlama.AIDefendTarget(this)); }
protected void initEntityAI() { this.tasks.addTask(1, new EntityAIAttackRanged(this, 1.25D, 20, 10.0F)); this.tasks.addTask(2, new EntityAIWanderAvoidWater(this, 1.0D, 1.0000001E-5F)); this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(4, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityLiving.class, 10, true, false, IMob.MOB_SELECTOR)); }
protected void initEntityAI() { this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 60, 10.0F)); this.tasks.addTask(2, new EntityAIWanderAvoidWater(this, 1.0D)); this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(3, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); }
protected void initEntityAI() { this.tasks.addTask(0, new EntityWither.AIDoNothing()); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 40, 20.0F)); this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D)); this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(7, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, false, NOT_UNDEAD)); }
protected void initEntityAI() { this.tasks.addTask(1, new EntityAIAttackRanged(this, 1.25D, 20, 10.0F)); this.tasks.addTask(2, new EntityAIWander(this, 1.0D)); this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(4, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityLiving.class, 10, true, false, IMob.MOB_SELECTOR)); }
protected void initEntityAI() { this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 60, 10.0F)); this.tasks.addTask(2, new EntityAIWander(this, 1.0D)); this.tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(3, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); }
protected void initEntityAI() { this.tasks.addTask(0, new EntityWither.AIDoNothing()); this.tasks.addTask(1, new EntityAISwimming(this)); this.tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 40, 20.0F)); this.tasks.addTask(5, new EntityAIWander(this, 1.0D)); this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); this.tasks.addTask(7, new EntityAILookIdle(this)); this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityLiving.class, 0, false, false, NOT_UNDEAD)); }
protected void ai() { tasks.addTask(1, new EntityAISwimming(this)); tasks.addTask(2, new EntityAIAttackRanged(this, 1.0D, 16, 10.0F)); tasks.addTask(3, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F)); tasks.addTask(3, new EntityAILookIdle(this)); targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0])); targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); }
@Override protected void initEntityAI() { super.initEntityAI(); tasks.addTask(1, new EntityAIAttackRanged(this, 0.6D, 80, 8.0F)); }