@Override public void setMoveTo(double x, double y, double z, double speedIn) { super.setMoveTo(x,y,z,speedIn); this.targetPos.setTarget(x, y, z); }
@Override public void onLivingUpdate() { if (getMoveHelper().isUpdating() && motionY < 0.0D) motionY *= 0.2D; else motionY *= 0.75D; if (isInWater()) getMoveHelper().setMoveTo(this.posX, this.posY + 1, this.posZ, 0.32D); super.onLivingUpdate(); }
@Override public boolean shouldExecute() { EntityMoveHelper moveHelper = this.dino.getMoveHelper(); if (!moveHelper.isUpdating()) { return true; } else { double moveX = moveHelper.getX() - this.dino.posX; double moveY = moveHelper.getY() - this.dino.posY; double moveZ = moveHelper.getZ() - this.dino.posZ; double distance = moveX * moveX + moveY * moveY + moveZ * moveZ; return distance < 1.0D || distance > 3600.0D; } }
protected float getJumpUpwardsMotion() { if (!collidedHorizontally && (!moveHelper.isUpdating() || moveHelper.getY() <= posY + 0.5D)) { Path path = navigator.getPath(); if (path != null && path.getCurrentPathIndex() < path.getCurrentPathLength()) { Vec3d vec3d = path.getPosition(this); if (vec3d.y > posY + 0.5D) return 0.5F; } return moveHelper.getSpeed() <= 0.6D ? 0.5F : 0.5F; } else { return 0.5F; } }
@Override public boolean shouldExecute() { return !this.pixie.getMoveHelper().isUpdating(); }
private void forceMove(BlockPos pos, EntityLiving ent) { double x = (pos.getX() + 0.5D - ent.posX); double y = (pos.getY() + 1D - ent.posY); double z = (pos.getZ() + 0.5D - ent.posZ); double distance = Math.sqrt(x * x + y * y + z * z); if (distance > 2) { EntityMob mod = (EntityMob) ent; mod.faceEntity(getTarget(ent.getEntityWorld(), pos), 180, 0); mod.getMoveHelper().strafe(0, 0.3f); if (mod.posY < pos.getY()) { mod.setJumping(true); } else { mod.setJumping(false); } } }
@Override public boolean shouldExecute() { return !this.butterfly.getMoveHelper().isUpdating(); }
@Override public void updateAITasks() { if (currentMoveTypeDuration > 0) { --currentMoveTypeDuration; } if (onGround) { if (!wasOnGround) { setJumping(false); checkLandingDelay(); } EntityGrasshopper.GrasshopperJumpHelper grasshopperjumphelper = (EntityGrasshopper.GrasshopperJumpHelper) jumpHelper; if (!grasshopperjumphelper.getIsJumping()) { if (moveHelper.isUpdating() && currentMoveTypeDuration == 0) { Path path = navigator.getPath(); Vec3d vec3d = new Vec3d(moveHelper.getX(), moveHelper.getY(), moveHelper.getZ()); if (path != null && path.getCurrentPathIndex() < path.getCurrentPathLength()) vec3d = path.getPosition(this); calculateRotationYaw(vec3d.x, vec3d.z); startJumping(); } } else if (!grasshopperjumphelper.canJump()) enableJumpControl(); } wasOnGround = onGround; }
this.entity.getMoveHelper().strafe(this.strafingBackwards ? -0.5F : 0.5F, this.strafingClockwise ? 0.5F : -0.5F); this.entity.faceEntity(entitylivingbase, 30.0F, 30.0F); } else {
@Override public void setMoveTo(double x, double y, double z, double speedIn) { super.setMoveTo(x,y,z,speedIn); this.targetPos.setTarget(x, y, z); }
@Override public boolean shouldExecute() { return !this.dragonfly.getMoveHelper().isUpdating(); }
this.entity.getMoveHelper().strafe(this.strafingBackwards ? -1.0F : 1.0F, this.strafingClockwise ? 0.5F : -0.5F); this.entity.faceEntity(entitylivingbase, 30.0F, 30.0F);
@Override public void setMoveTo(double x, double y, double z, double speedIn) { super.setMoveTo(x,y,z,speedIn); this.targetPos.setTarget(x, y, z); }
/** * Returns whether the EntityAIBase should begin execution. */ public boolean shouldExecute() { return !EntityGaiaBanshee.this.getMoveHelper().isUpdating() && EntityGaiaBanshee.this.rand.nextInt(7) == 0; }
@Override public void setMoveTo(double x, double y, double z, double speedIn) { if (grasshopper.isInWater()) speedIn = 1.5D; super.setMoveTo(x, y, z, speedIn); if (speedIn > 0.0D) nextJumpSpeed = speedIn; } }
public boolean shouldExecute() { if (EntityAmphithere.this.flightBehavior != FlightBehavior.WANDER) { return false; } if (EntityAmphithere.this.isFlying()) { 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); EntityAmphithere.this.orbitPos = null; return (!EntityAmphithere.this.getMoveHelper().isUpdating() || EntityAmphithere.this.ticksStill >= 50); } else { return false; } }
this.entity.getMoveHelper().strafe(this.strafingBackwards ? -0.5F : 0.5F, this.strafingClockwise ? 0.5F : -0.5F); this.entity.faceEntity(entitylivingbase, 30.0F, 30.0F); } else {
@Override public void setMoveTo(double x, double y, double z, float moveSpeed) { getMoveHelper().setMoveTo(x, y, z, moveSpeed); }