@Override public void resetTask() { super.resetTask(); retreating = false; followTask.resetTask(); }
@Override public boolean shouldContinueExecuting() { return super.shouldContinueExecuting() || retreating; }
/** * Execute a one shot task or start executing a continuous task */ @Override public void startExecuting() { super.startExecuting(); this.raiseArmTicks = 0; }
@Override public void updateTask() { if (retreating) { followTask.updateTask(); if (followTask.isWithinTargetDistanceFromOwner()) { retreating = false; followTask.resetTask(); super.startExecuting(); } return; } if (isTooFarFromOwner()) { retreating = true; followTask.startExecuting(); return; } super.updateTask(); }
@Override public void setCombatTask() { if (aiAttackOnCollide != null) { this.tasks.removeTask(aiAttackOnCollide); } aiAttackOnCollide = new EntityAIAttackMelee(this, this.getBaseSprintModifier(getType()), false); this.tasks.addTask(attackPriority, aiAttackOnCollide); }
public void updateTask() { super.updateTask(); this.attackTick = 0; } }
this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
/** * Keep ticking a continuous task that has already been started */ @Override public void updateTask() { super.updateTask(); ++this.raiseArmTicks; if (this.raiseArmTicks >= 5 && this.attackTick < 10) { if (entity instanceof EntityBackupZombie) ((EntityBackupZombie) entity).setArmsRaised(true); } else { if (entity instanceof EntityBackupZombie) ((EntityBackupZombie) entity).setArmsRaised(false); } } }
public EntityBasicHunter(World world) { super(world, true); saveHome = true; ((PathNavigateGround) this.getNavigator()).setEnterDoors(true); this.setSize(0.6F, 1.95F); this.setDontDropEquipment(); this.attackMelee = new EntityAIAttackMelee(this, 1.0, false); this.attackRange = new EntityAIAttackRangedCrossbow(this, this, 0.6, 60, 20); this.updateCombatTask(); }
/** * Resets the task */ @Override public void resetTask() { super.resetTask(); this.weirdZombie.setArmsRaised(false); }
/** * Execute a one shot task or start executing a continuous task */ @Override public void startExecuting() { super.startExecuting(); this.raiseArmTicks = 0; }
@Override public boolean shouldContinueExecuting() { return !EntityVampireBaron.this.rangedAttack && super.shouldContinueExecuting(); }
/** * Updates the task */ @Override public void updateTask() { super.updateTask(); ++this.raiseArmTicks; if (this.raiseArmTicks >= 5 && this.attackTick < 10) { this.weirdZombie.setArmsRaised(true); } else { this.weirdZombie.setArmsRaised(false); } } }
public EntityBogMaw(World world) { super(world); stepHeight = 0.0F; setSize(1.0F, 0.8F); tasks.addTask(0, new EntityAILeapAtTarget(this, 0.5F)); tasks.addTask(1, new EntityAIAttackMelee(this, 0, true)); targetTasks.addTask(0, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true)); }
/** * Reset the task's internal state. Called when this task is interrupted by another one */ @Override public void resetTask() { super.resetTask(); if (entity instanceof EntityBackupZombie) ((EntityBackupZombie) entity).setArmsRaised(false); }
public void startExecuting() { super.startExecuting(); EntityGaiaKobold.this.setSwingingArms(true); } };
@Override public boolean shouldContinueExecuting() { if(this.attacker != null && super.shouldContinueExecuting()) { EntityLivingBase target = this.attacker.getAttackTarget(); if (target instanceof DinosaurEntity && ((DinosaurEntity) target).isCarcass()) { return false; } return true; } return false; }
@Override protected void initEntityAI() { tasks.addTask(0, new EntityAISwimming(this)); tasks.addTask(1, new EntityAIAttackMelee(this, 0.5D, true)); targetTasks.addTask(0, new EntityAIHurtByTarget(this, false)); targetTasks.addTask(1, new EntityAINearestAttackableTarget(this, EntityPlayer.class, false)); }
public void resetTask() { super.resetTask(); EntityGaiaCentaur.this.setSwingingArms(false); }
public void startExecuting() { super.startExecuting(); EntityGaiaSelkie.this.setSwingingArms(true); } };