Class LookControl
java.lang.Object
net.minecraft.world.entity.ai.control.LookControl
- All Implemented Interfaces:
Control
- Direct Known Subclasses:
Bee.BeeLookControl
,Camel.CamelLookControl
,Fox.FoxLookControl
,Frog.FrogLookControl
,Phantom.PhantomLookControl
,Shulker.ShulkerLookControl
,SmoothSwimmingLookControl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected int
protected final Mob
protected double
protected double
protected double
protected float
protected float
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
double
double
private static double
getWantedY
(Entity entity) double
getXRotD()
getYRotD()
boolean
protected boolean
protected float
rotateTowards
(float from, float to, float maxDelta) Rotate as much as possible fromfrom
toto
within the bounds ofmaxDelta
void
setLookAt
(double x, double y, double z) void
setLookAt
(double x, double y, double z, float deltaYaw, float deltaPitch) Sets position to look atvoid
Sets the controlling mob's look vector to the provided entity's locationvoid
Sets position to look at using entityvoid
Sets the mob's look vectorvoid
tick()
-
Field Details
-
mob
-
yMaxRotSpeed
protected float yMaxRotSpeed -
xMaxRotAngle
protected float xMaxRotAngle -
lookAtCooldown
protected int lookAtCooldown -
wantedX
protected double wantedX -
wantedY
protected double wantedY -
wantedZ
protected double wantedZ
-
-
Constructor Details
-
LookControl
-
-
Method Details
-
setLookAt
Sets the mob's look vector -
setLookAt
Sets the controlling mob's look vector to the provided entity's location -
setLookAt
Sets position to look at using entity -
setLookAt
public void setLookAt(double x, double y, double z) -
setLookAt
public void setLookAt(double x, double y, double z, float deltaYaw, float deltaPitch) Sets position to look at -
tick
public void tick() -
clampHeadRotationToBody
protected void clampHeadRotationToBody() -
resetXRotOnTick
protected boolean resetXRotOnTick() -
isLookingAtTarget
public boolean isLookingAtTarget() -
getWantedX
public double getWantedX() -
getWantedY
public double getWantedY() -
getWantedZ
public double getWantedZ() -
getXRotD
-
getYRotD
-
rotateTowards
protected float rotateTowards(float from, float to, float maxDelta) Rotate as much as possible fromfrom
toto
within the bounds ofmaxDelta
-
getWantedY
-