Class MoveControl

java.lang.Object
net.minecraft.world.entity.ai.control.MoveControl
All Implemented Interfaces:
Control
Direct Known Subclasses:
AbstractFish.FishMoveControl, Camel.CamelMoveControl, Drowned.DrownedMoveControl, FlyingMoveControl, Fox.FoxMoveControl, Ghast.GhastMoveControl, Guardian.GuardianMoveControl, Panda.PandaMoveControl, Phantom.PhantomMoveControl, Rabbit.RabbitMoveControl, Slime.SlimeMoveControl, SmoothSwimmingMoveControl, Turtle.TurtleMoveControl, Vex.VexMoveControl

public class MoveControl extends Object implements Control
  • Field Details

    • MIN_SPEED

      public static final float MIN_SPEED
      See Also:
    • MIN_SPEED_SQR

      public static final float MIN_SPEED_SQR
      See Also:
    • MAX_TURN

      protected static final int MAX_TURN
      See Also:
    • mob

      protected final Mob mob
    • wantedX

      protected double wantedX
    • wantedY

      protected double wantedY
    • wantedZ

      protected double wantedZ
    • speedModifier

      protected double speedModifier
    • strafeForwards

      protected float strafeForwards
    • strafeRight

      protected float strafeRight
    • operation

      protected MoveControl.Operation operation
  • Constructor Details

    • MoveControl

      public MoveControl(Mob pMob)
  • Method Details

    • hasWanted

      public boolean hasWanted()
    • getSpeedModifier

      public double getSpeedModifier()
    • setWantedPosition

      public void setWantedPosition(double pX, double pY, double pZ, double pSpeed)
      Sets the speed and location to move to
    • strafe

      public void strafe(float pForward, float pStrafe)
    • tick

      public void tick()
    • isWalkable

      private boolean isWalkable(float pRelativeX, float pRelativeZ)
      Returns:
      true if the mob can walk successfully to a given X and Z
    • rotlerp

      protected float rotlerp(float pSourceAngle, float pTargetAngle, float pMaximumChange)
      Attempt to rotate the first angle to become the second angle, but only allow overall direction change to at max be third parameter
    • getWantedX

      public double getWantedX()
    • getWantedY

      public double getWantedY()
    • getWantedZ

      public double getWantedZ()