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
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intstatic final floatstatic final floatprotected final Mobprotected MoveControl.Operationprotected doubleprotected floatprotected floatprotected doubleprotected doubleprotected double -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubledoubledoubledoublebooleanprivate booleanisWalkable(float relativeX, float relativeZ) protected floatrotlerp(float sourceAngle, float targetAngle, float maximumChange) Attempt to rotate the first angle to become the second angle, but only allow overall direction change to at max be third parametervoidsetWantedPosition(double x, double y, double z, double speed) Sets the speed and location to move tovoidstrafe(float forward, float strafe) voidtick()
-
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
-
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
-
-
Constructor Details
-
MoveControl
-
-
Method Details
-
hasWanted
public boolean hasWanted() -
getSpeedModifier
public double getSpeedModifier() -
setWantedPosition
public void setWantedPosition(double x, double y, double z, double speed) Sets the speed and location to move to -
strafe
public void strafe(float forward, float strafe) -
tick
public void tick() -
isWalkable
private boolean isWalkable(float relativeX, float relativeZ) - Returns:
- true if the mob can walk successfully to a given X and Z
-
rotlerp
protected float rotlerp(float sourceAngle, float targetAngle, float maximumChange) 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()
-