@Override public void updateTask() { super.updateTask(); if (this.targetEntity == null || this.targetEntity != null && this.targetEntity.isDead) { this.resetTask(); } if (this.targetEntity != null && !this.targetEntity.isDead && this.taskOwner.getDistanceSq(this.targetEntity) < 2) { this.targetEntity.startRiding(this.myrmex); resetTask(); } }
@Override public void updateTask() { super.updateTask(); if (this.targetEntity == null || this.targetEntity != null && (this.targetEntity.isDead || this.targetEntity.isInWater())) { this.resetTask(); } if (this.targetEntity != null && !this.targetEntity.isDead && this.taskOwner.getDistanceSq(this.targetEntity) < 1) { this.myrmex.onPickupItem(targetEntity); this.myrmex.setHeldItem(EnumHand.MAIN_HAND, this.targetEntity.getItem()); this.targetEntity.setDead(); resetTask(); } }
@Override public void updateTask() { super.updateTask(); if (this.targetEntity == null || this.targetEntity != null && this.targetEntity.isDead) { this.resetTask(); } if (this.targetEntity != null && !this.targetEntity.isDead && this.taskOwner.getDistanceSq(this.targetEntity) < 1) { EntityDeathWorm deathWorm = (EntityDeathWorm) this.taskOwner; this.targetEntity.getItem().shrink(1); this.taskOwner.playSound(SoundEvents.ENTITY_GENERIC_EAT, 1, 1); deathWorm.setAnimation(EntityDeathWorm.ANIMATION_BITE); deathWorm.setExplosive(true); resetTask(); } }
@Override public void updateTask() { super.updateTask(); if (this.targetEntity == null || this.targetEntity != null && this.targetEntity.isDead) { this.resetTask(); } if (this.targetEntity != null && !this.targetEntity.isDead && this.taskOwner.getDistanceSq(this.targetEntity) < 1) { EntityCockatrice cockatrice = (EntityCockatrice) this.taskOwner; this.targetEntity.getItem().shrink(1); this.taskOwner.playSound(SoundEvents.ENTITY_GENERIC_EAT, 1, 1); cockatrice.heal(8); cockatrice.setAnimation(EntityCockatrice.ANIMATION_EAT); resetTask(); } }
@Override public void updateTask() { super.updateTask(); if (this.targetEntity == null || this.targetEntity != null && this.targetEntity.isDead) { this.resetTask(); } if (this.targetEntity != null && !this.targetEntity.isDead && this.taskOwner.getDistanceSq(this.targetEntity) < 1) { EntityHippogryph hippo = (EntityHippogryph) this.taskOwner; this.targetEntity.getItem().shrink(1); this.taskOwner.playSound(SoundEvents.ENTITY_GENERIC_EAT, 1, 1); hippo.setAnimation(EntityHippogryph.ANIMATION_EAT); hippo.heal(4); if (hippo.getRNG().nextInt(3) == 0 && !hippo.isTamed() && this.targetEntity.getThrower() != null && !this.targetEntity.getThrower().isEmpty() && this.taskOwner.world.getPlayerEntityByName(this.targetEntity.getThrower()) != null) { EntityPlayer owner = this.taskOwner.world.getPlayerEntityByName(this.targetEntity.getThrower()); hippo.setTamed(true); hippo.setOwnerId(owner.getUniqueID()); hippo.setAttackTarget(null); //owner.addStat(ModAchievements.tameHippogryph); hippo.setSitting(true); } resetTask(); } }
@Override public void updateTask() { super.updateTask(); if (this.targetEntity == null || this.targetEntity != null && this.targetEntity.isDead) { this.resetTask(); } if (this.targetEntity != null && !this.targetEntity.isDead && this.taskOwner.getDistanceSq(this.targetEntity) < 1) { this.targetEntity.getItem().shrink(1); this.taskOwner.playSound(SoundEvents.ENTITY_GENERIC_EAT, 1, 1); int hunger = FoodUtils.getFoodPoints(this.targetEntity.getItem(), true, isIce); ((EntityDragonBase) this.taskOwner).setHunger(Math.min(100, ((EntityDragonBase) this.taskOwner).getHunger() + hunger)); ((EntityDragonBase) this.taskOwner).eatFoodBonus(this.targetEntity.getItem()); this.taskOwner.setHealth(Math.min(this.taskOwner.getMaxHealth(), (int) (this.taskOwner.getHealth() + FoodUtils.getFoodPoints(this.targetEntity.getItem(), true, isIce)))); if (EntityDragonBase.ANIMATION_EAT != null) { ((EntityDragonBase) this.taskOwner).setAnimation(EntityDragonBase.ANIMATION_EAT); } for (int i = 0; i < 4; i++) { ((EntityDragonBase) this.taskOwner).spawnItemCrackParticles(this.targetEntity.getItem().getItem()); } resetTask(); } }
@Override public void updateTask() { super.updateTask(); if (this.targetEntity == null || this.targetEntity != null && this.targetEntity.isDead) { this.resetTask(); } if (this.targetEntity != null && !this.targetEntity.isDead && this.taskOwner.getDistanceSq(this.targetEntity) < 1) { EntityPixie pixie = (EntityPixie) this.taskOwner; if(this.targetEntity.getItem() != null && this.targetEntity.getItem().getItem() != null && this.targetEntity.getItem().getItem() == Items.SUGAR) { pixie.heal(5); } if(this.targetEntity.getItem() != null && this.targetEntity.getItem().getItem() != null && this.targetEntity.getItem().getItem() == Items.CAKE) { if (!pixie.isTamed() && this.targetEntity.getThrower() != null && !this.targetEntity.getThrower().isEmpty() && this.taskOwner.world.getPlayerEntityByName(this.targetEntity.getThrower()) != null) { EntityPlayer owner = this.taskOwner.world.getPlayerEntityByName(this.targetEntity.getThrower()); pixie.setTamed(true); pixie.setOwnerId(owner.getUniqueID()); pixie.setSitting(true); } } this.targetEntity.getItem().shrink(1); pixie.playSound(ModSounds.PIXIE_TAUNT, 1F, 1F); resetTask(); } }