private void setAdditionalAItasks() { if (!this.areAdditionalTasksSet) { this.areAdditionalTasksSet = true; if (this.isChild()) { this.tasks.addTask(8, new EntityAIPlay(this, 0.32D)); } else if (this.getProfession() == 0) { this.tasks.addTask(6, new EntityAIHarvestFarmland(this, 0.6D)); } } }
/** * This is called when Entity's growing age timer reaches 0 (negative values are considered as a child, positive as * an adult) */ protected void onGrowingAdult() { if (this.getProfession() == 0) { this.tasks.addTask(8, new EntityAIHarvestFarmland(this, 0.6D)); } super.onGrowingAdult(); }
@Override public AIHarvestFarmland newAIHarvestFarmland(Villager villager, double speed) { return (AIHarvestFarmland) new EntityAIHarvestFarmland((EntityVillager) villager, speed); }