public void startExecuting() { this.stymphalianBird.getMoveHelper().setMoveTo(hidePlace.x, hidePlace.y, hidePlace.z, 3D); this.stymphalianBird.getLookHelper().setLookPosition(hidePlace.x, hidePlace.y, hidePlace.z, 180.0F, 20.0F); }
/** * Updates the task */ @Override public void updateTask() { double lx = watchedEntity.posX; double ly = watchedEntity.posY + watchedEntity.getEyeHeight(); double lz = watchedEntity.posZ; dragon.getLookHelper().setLookPosition(lx, ly, lz, 10, dragon.getVerticalFaceSpeed()); watchTicks--; } }
public void startExecuting() { this.pixie.getMoveHelper().setMoveTo(hidePlace.x, hidePlace.y, hidePlace.z, 1D); this.pixie.getLookHelper().setLookPosition(hidePlace.x, hidePlace.y, hidePlace.z, 180.0F, 20.0F); }
@Override public void updateTask() { --this.idleTime; this.dragon.getLookHelper().setLookPosition(this.dragon.posX + this.lookX, this.dragon.posY + this.dragon.getEyeHeight(), this.dragon.posZ + this.lookZ, this.dragon.getHorizontalFaceSpeed(), this.dragon.getVerticalFaceSpeed()); } }
@Override public void updateTask() { if(!swimmingEntity.getLookHelper().getIsLooking()) this.swimmingEntity.getLookHelper().setLookPosition(this.xPosition * .75, this.yPosition * .75, this.zPosition * .75, -5F, swimmingEntity.getVerticalFaceSpeed()); }
public void forcePreyToLook(EntityLiving mob) { mob.getLookHelper().setLookPosition(this.posX, this.posY + (double) this.getEyeHeight(), this.posZ, (float) mob.getHorizontalFaceSpeed(), (float) mob.getVerticalFaceSpeed()); }
public void forcePreyToLook(EntityLiving mob) { mob.getLookHelper().setLookPosition(this.posX, this.posY + (double) this.getEyeHeight(), this.posZ, (float) mob.getHorizontalFaceSpeed(), (float) mob.getVerticalFaceSpeed()); }
@Override public void startExecuting() { this.taskOwner.getMoveHelper().setMoveTo(this.targetEntity.posX, this.targetEntity.posY, this.targetEntity.posZ, 0.25D); if (this.taskOwner.getAttackTarget() == null) { this.taskOwner.getLookHelper().setLookPosition(this.targetEntity.posX, this.targetEntity.posY, this.targetEntity.posZ, 180.0F, 20.0F); } super.startExecuting(); }
public void updateTask() { target = EntityAmphithere.getPositionRelativetoGround(EntityAmphithere.this, EntityAmphithere.this.world, EntityAmphithere.this.posX + EntityAmphithere.this.rand.nextInt(30) - 15, EntityAmphithere.this.posZ + EntityAmphithere.this.rand.nextInt(30) - 15, EntityAmphithere.this.rand); if (EntityAmphithere.this.world.isAirBlock(target)) { EntityAmphithere.this.moveHelper.setMoveTo((double) target.getX() + 0.5D, (double) target.getY() + 0.5D, (double) target.getZ() + 0.5D, 0.25D); if (EntityAmphithere.this.getAttackTarget() == null) { EntityAmphithere.this.getLookHelper().setLookPosition((double) target.getX() + 0.5D, (double) target.getY() + 0.5D, (double) target.getZ() + 0.5D, 180.0F, 20.0F); } } } }
private void setVillagerLook() { this.villager.getLookHelper().setLookPosition( (double) this.destinationBlock.getX() + this.standingOffset + 0.5D, (double) (this.destinationBlock.getY() + 1), (double) this.destinationBlock.getZ() + 0.5D, 10.0F, (float) this.villager.getVerticalFaceSpeed()); this.villager.setRotationYawHead((this.standingOffset == -1) ? 270 : 90); }
public void updateTask() { if (!isDirectPathBetweenPoints(EntityMyrmexRoyal.this.getPosition(), target)) { target = EntityMyrmexRoyal.getPositionRelativetoGround(EntityMyrmexRoyal.this, EntityMyrmexRoyal.this.world, EntityMyrmexRoyal.this.posX + EntityMyrmexRoyal.this.rand.nextInt(15) - 7, EntityMyrmexRoyal.this.posZ + EntityMyrmexRoyal.this.rand.nextInt(15) - 7, EntityMyrmexRoyal.this.rand); } if (EntityMyrmexRoyal.this.world.isAirBlock(target)) { EntityMyrmexRoyal.this.moveHelper.setMoveTo((double) target.getX() + 0.5D, (double) target.getY() + 0.5D, (double) target.getZ() + 0.5D, 0.25D); if (EntityMyrmexRoyal.this.getAttackTarget() == null) { EntityMyrmexRoyal.this.getLookHelper().setLookPosition((double) target.getX() + 0.5D, (double) target.getY() + 0.5D, (double) target.getZ() + 0.5D, 180.0F, 20.0F); } } } }
public void updateTask() { if (!isDirectPathBetweenPoints(EntityPixie.this.getPosition(), target)) { target = EntityPixie.getPositionRelativetoGround(EntityPixie.this, EntityPixie.this.world, EntityPixie.this.posX + EntityPixie.this.rand.nextInt(15) - 7, EntityPixie.this.posZ + EntityPixie.this.rand.nextInt(15) - 7, EntityPixie.this.rand); } if (EntityPixie.this.world.isAirBlock(target)) { EntityPixie.this.moveHelper.setMoveTo((double) target.getX() + 0.5D, (double) target.getY() + 0.5D, (double) target.getZ() + 0.5D, 0.25D); if (EntityPixie.this.getAttackTarget() == null) { EntityPixie.this.getLookHelper().setLookPosition((double) target.getX() + 0.5D, (double) target.getY() + 0.5D, (double) target.getZ() + 0.5D, 180.0F, 20.0F); } } } }
/** * Keep ticking a continuous task that has already been started */ public void updateTask() { BlockPos blockpos = EntityGaiaBanshee.this.getBoundOrigin(); if (blockpos == null) { blockpos = new BlockPos(EntityGaiaBanshee.this); } for (int i = 0; i < 3; ++i) { BlockPos blockpos1 = blockpos.add(EntityGaiaBanshee.this.rand.nextInt(15) - 7, EntityGaiaBanshee.this.rand.nextInt(11) - 5, EntityGaiaBanshee.this.rand.nextInt(15) - 7); if (EntityGaiaBanshee.this.world.isAirBlock(blockpos1)) { EntityGaiaBanshee.this.moveHelper.setMoveTo((double) blockpos1.getX() + 0.5D, (double) blockpos1.getY() + 0.5D, (double) blockpos1.getZ() + 0.5D, 0.25D); if (EntityGaiaBanshee.this.getAttackTarget() == null) { EntityGaiaBanshee.this.getLookHelper().setLookPosition((double) blockpos1.getX() + 0.5D, (double) blockpos1.getY() + 0.5D, (double) blockpos1.getZ() + 0.5D, 180.0F, 20.0F); } break; } } } }
@Override public void updateTask() { EntityCreature e = creature.getEntity(); if (vampireEntity instanceof EntityLiving) { ((EntityLiving) vampireEntity).getLookHelper().setLookPosition(e.posX, e.posY + (double) e.getEyeHeight(), e.posZ, 10.0F, (float) ((EntityLiving) vampireEntity).getVerticalFaceSpeed()); } timer--; if (timer == 1) { int amount = creature.onBite(vampire); vampireEntity.playSound(ModSounds.player_bite, 1, 1); vampire.drinkBlood(amount, creature.getBloodSaturation()); } }
private void manageShooting(boolean canSeeTarget, double distanceToTargetSq) { this.entityHost.getLookHelper().setLookPosition(this.lastKnownShootLocation.x, this.lastKnownShootLocation.y + attackTarget.getEyeHeight(), this.lastKnownShootLocation.z, 30.0F, 30.0F); ItemStack weapon = rangedAttackEntityHost.getWeapon(); if (this.rangedAttackDelayTime == 0 && weapon != null && weapon.getItem() instanceof EnergyWeapon && ((EnergyWeapon) weapon.getItem()).canFire(weapon, entityHost.world, entityHost)) { if (distanceToTargetSq > (double) this.maxChaseDistanceSq) { return; } this.rangedAttackEntityHost.attackEntityWithRangedAttack(this.attackTarget, lastKnownShootLocation, canSeeTarget); this.rangedAttackDelayTime = this.maxRangedAttackDelay; } else if (this.rangedAttackDelayTime < 0) { this.rangedAttackDelayTime = this.maxRangedAttackDelay; } else if (this.rangedAttackDelayTime > 0) { this.rangedAttackDelayTime--; } }
@Override public void updateTask() { if (--this.delayCounter <= 0 && entity.getAdvancedLeader() != null) { this.delayCounter = 10; this.entity.getNavigator().tryMoveToEntityLiving(this.entity.getAdvancedLeader(), this.speed); this.entity.getLookHelper().setLookPosition(this.entity.getAdvancedLeader().posX, this.entity.getAdvancedLeader().posY + (double) this.entity.getAdvancedLeader().getEyeHeight(), this.entity.getAdvancedLeader().posZ, (float) this.entity.getHorizontalFaceSpeed(), (float) this.entity.getVerticalFaceSpeed()); } } }
public void updateTask() { if (EntityAmphithere.this.getDistance(target.getX(), target.getY(), target.getZ()) < 5) { target = EntityAmphithere.getPositionInOrbit(EntityAmphithere.this, world, EntityAmphithere.this.orbitPos, EntityAmphithere.this.rand); } if (EntityAmphithere.this.world.isAirBlock(target)) { EntityAmphithere.this.moveHelper.setMoveTo((double) target.getX() + 0.5D, (double) target.getY() + 0.5D, (double) target.getZ() + 0.5D, 0.25D); if (EntityAmphithere.this.getAttackTarget() == null) { EntityAmphithere.this.getLookHelper().setLookPosition((double) target.getX() + 0.5D, (double) target.getY() + 0.5D, (double) target.getZ() + 0.5D, 180.0F, 20.0F); } } } }
@Override public void updateTask() { super.updateTask(); World world = animal.world; if (animal.getDistance(destinationBlock.getX(), destinationBlock.getY(), destinationBlock.getZ()) <= 1D) { animal.getLookHelper().setLookPosition((double)destinationBlock.getX() + 0.5D, (double)(destinationBlock.getY()), (double)destinationBlock.getZ() + 0.5D, 10.0F, (float)animal.getVerticalFaceSpeed()); if (eatTimer == 0) eatTimer = 50; else eatTimer--; if (eatTimer <= 0) { IBlockState iblockstate = world.getBlockState(destinationBlock); if (currentTask == 1 && isEdible(destinationBlock, iblockstate)) { eat(destinationBlock, iblockstate); } currentTask = -1; runDelay = 10; } } }
public void updateTask() { BlockPos blockpos = EntityPixie.this.getHousePos() == null ? EntityPixie.this.getPosition() : EntityPixie.this.getHousePos(); if (blockpos == null) { blockpos = new BlockPos(EntityPixie.this); } for (int i = 0; i < 3; ++i) { BlockPos blockpos1 = findAHouse(EntityPixie.this, EntityPixie.this.world); EntityPixie.this.moveHelper.setMoveTo((double) blockpos1.getX() + 0.5D, (double) blockpos1.getY() + 0.5D, (double) blockpos1.getZ() + 0.5D, 0.25D); EntityPixie.this.housePos = blockpos1; if (EntityPixie.this.getAttackTarget() == null) { EntityPixie.this.getLookHelper().setLookPosition((double) blockpos1.getX() + 0.5D, (double) blockpos1.getY() + 0.5D, (double) blockpos1.getZ() + 0.5D, 180.0F, 20.0F); } } } }
@Override public void updateTask() { if (this.giveUpTime > 0) { this.giveUpTime--; } if (this.path != null) { this.dinosaur.getNavigator().setPath(this.path, 1.0); Vec3d center = new Vec3d(this.pos.getX() + 0.5, this.pos.getY() + 0.5, this.pos.getZ() + 0.5); if (this.path.isFinished() || (this.dinosaur.getEntityBoundingBox().expand(2, 2, 2).intersectsWithXY(center) && this.giveUpTime < 10)) { this.dinosaur.getLookHelper().setLookPosition(this.pos.getX() + 0.5, this.pos.getY() + 0.5, this.pos.getZ() + 0.5, 10.0F, 10.0F); this.dinosaur.setAnimation(EntityAnimation.DRINKING.get()); MetabolismContainer metabolism = this.dinosaur.getMetabolism(); metabolism.setWater(metabolism.getWater() + (metabolism.getMaxWater() / 8)); } } }