Interface EntityController
public interface EntityController
Represents an Entity Controller, used for calling direct actions for an entity.
For long-term paths in movement, it is recommended to use EntityNavigation
.
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Get the current Speed Modifier that this Entity has, if it is moving.Gets the Delta Movement of this Entity.default double
Gets the ΔX of this Entity.default double
Gets the ΔY of this Entity.default double
Gets the ΔZ of this Entity.Get the Location that this Entity is trying to look at.Get the Location that this Entity is trying to move towards.boolean
Whether this Mob is looking at the last Look Target.jump()
Forces this Entity to jump naturally.lookAt
(double x, double y, double z) Makes this Entity look at coordinates.default EntityController
Makes this Entity look at a Location.default EntityController
Makes this Entity look at another entity.default EntityController
moveTo
(double x, double y, double z) Moves an Entity to the specified coordinates, with no speed modifier.moveTo
(double x, double y, double z, double speedMod) Moves an Entity to the specified coordinates.default EntityController
Moves an Entity to the specified Location, with no speed modifier.default EntityController
Moves an Entity to the specified Location.default EntityController
Moves an Entity to another Entity, with no speed modifier.default EntityController
Moves an Entity to another Entity.naturalMoveTo
(double x, double y, double z, NaturalMoveType type) Performs a Natural Entity Movement.default void
setDeltaMovement
(double x, double y, double z) Sets the Delta Movement of this Entity.void
setDeltaMovement
(@NotNull Vector delta) Sets the Delta Movement of this Entity.default void
setDeltaMovementX
(double x) Sets the ΔX of this Entity.default void
setDeltaMovementY
(double y) Sets the ΔY of this Entity.default void
setDeltaMovementZ
(double z) Sets the ΔZ of this Entity.strafe
(float fwd, float right) Makes this Entity strafe.
-
Method Details
-
jump
EntityController jump()Forces this Entity to jump naturally.- Returns:
- this controller, for chaining
-
lookAt
Makes this Entity look at another entity.- Parameters:
en
- Entity to look at- Returns:
- this controller, for chaining
-
lookAt
Makes this Entity look at a Location.- Parameters:
loc
- Location to look at- Returns:
- this controller, for chaining
-
lookAt
Makes this Entity look at coordinates.- Parameters:
x
- X coordy
- Y coordz
- Z coord- Returns:
- this controller, for chaining
-
moveTo
Moves an Entity to another Entity, with no speed modifier.- Parameters:
en
- Entity to move to- Returns:
- this controller, for chaining
-
moveTo
Moves an Entity to another Entity.- Parameters:
en
- Entity to move tospeedMod
- Speed Modifier- Returns:
- this controller, for chaining
-
moveTo
Moves an Entity to the specified Location, with no speed modifier.- Parameters:
loc
- Location to move to- Returns:
- this controller, for chaining
-
moveTo
Moves an Entity to the specified Location.- Parameters:
loc
- Location to move tospeedMod
- Speed Modifier- Returns:
- this controller, for chaining
-
moveTo
Moves an Entity to the specified coordinates, with no speed modifier.- Parameters:
x
- X coordy
- Y coordz
- Z coord- Returns:
- this controller, for chaining
-
moveTo
Moves an Entity to the specified coordinates.- Parameters:
x
- X coordy
- Y coordz
- Z coordspeedMod
- Speed Modifier- Returns:
- this controller, for chaining
-
naturalMoveTo
Performs a Natural Entity Movement.
The X, Y, and Z are relative to the entity's current location.
Example:
naturalMoveTo(1, 0, 3,
NaturalMoveType.SELF
)
is a natural movement by the entity's self +1 X-Axis step and +3 Z-Axis steps.- Parameters:
x
- Relative X to move byy
- Relative Y to move byz
- Relative Z to move bytype
- Natural Movement Type- Returns:
- this controller, for chaining
-
strafe
Makes this Entity strafe.- Parameters:
fwd
- Amount to strafe forwards (negative for backwards)right
- Amount to strafe right (negative for left)- Returns:
- this controller, for chaining
-
getCurrentSpeedModifier
double getCurrentSpeedModifier()Get the current Speed Modifier that this Entity has, if it is moving.- Returns:
- Current Speed Modifier
-
getTargetMoveLocation
Location getTargetMoveLocation()Get the Location that this Entity is trying to move towards.- Returns:
- Target Move Location
-
getTargetLookLocation
Location getTargetLookLocation()Get the Location that this Entity is trying to look at.- Returns:
- Target Look Location
-
isLookingAtTarget
boolean isLookingAtTarget()Whether this Mob is looking at the last Look Target.- Returns:
- true if looking, else false
-
getDeltaMovement
Gets the Delta Movement of this Entity.- Returns:
- Delta Movement
-
setDeltaMovement
Sets the Delta Movement of this Entity.Delta Movement is a vector representing the current motion of an entity. You can use it to manually change the direction of motion for an entity without calculating for any collisions.
- Parameters:
delta
- Delta Movement
-
setDeltaMovement
default void setDeltaMovement(double x, double y, double z) Sets the Delta Movement of this Entity.- Parameters:
x
- Δxy
- ΔYz
- ΔZ
-
getDeltaMovementX
default double getDeltaMovementX()Gets the ΔX of this Entity.- Returns:
- ΔX
-
setDeltaMovementX
default void setDeltaMovementX(double x) Sets the ΔX of this Entity.- Parameters:
x
- New ΔX
-
getDeltaMovementY
default double getDeltaMovementY()Gets the ΔY of this Entity.- Returns:
- ΔY
-
setDeltaMovementY
default void setDeltaMovementY(double y) Sets the ΔY of this Entity.- Parameters:
y
- New ΔY
-
getDeltaMovementZ
default double getDeltaMovementZ()Gets the ΔZ of this Entity.- Returns:
- ΔZ
-
setDeltaMovementZ
default void setDeltaMovementZ(double z) Sets the ΔZ of this Entity.- Parameters:
z
- New ΔZ
-