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 int
static final float
static final float
protected final Mob
protected MoveControl.Operation
protected double
protected float
protected float
protected double
protected double
protected double
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
double
double
double
boolean
private boolean
isWalkable
(float pRelativeX, float pRelativeZ) 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 parametervoid
setWantedPosition
(double pX, double pY, double pZ, double pSpeed) Sets the speed and location to move tovoid
strafe
(float pForward, float pStrafe) void
tick()
-
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 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()
-