Interface MoveController
- All Known Implementing Classes:
EmptyMoveController
public interface MoveController
Wrapper interface for controlling the movement of a living entity.
This will not work on entities with no AI. Use
This will not work on entities with no AI. Use
LivingEntity.hasAI()
to check.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addVelocity
(double x, double y, double z) Add velocity to the entity.float
getSpeed()
Get the value of the movement speed attribute of this entity.org.bukkit.util.Vector
Get the current velocity of this entity.boolean
Get the true ground state of this entity.
This is necessary since the default ground state obtain throughEntity.isOnGround()
is forcefully set to true to maintain consistent movement speed.void
jump()
Cause the entity to jump.void
move
(float side, float front, float speed) Move the entity relative to its rotation.void
movePassenger
(org.bukkit.entity.Entity entity, double x, double y, double z) Synced method for moving a rider of this entity to the correct locationvoid
Reset fall distance of this entity.
This is used to stop the entity from taking fall damage.void
setVelocity
(double x, double y, double z) Override the entity's velocity.
-
Method Details
-
move
void move(float side, float front, float speed) Move the entity relative to its rotation.- Parameters:
side
- side step strengthfront
- forward step strengthspeed
- speed multiplier
-
jump
void jump()Cause the entity to jump. -
setVelocity
void setVelocity(double x, double y, double z) Override the entity's velocity.- Parameters:
x
- x velocity in world spacey
- y velocity in world spacez
- z velocity in world space
-
addVelocity
void addVelocity(double x, double y, double z) Add velocity to the entity.- Parameters:
x
- x velocity in world spacey
- y velocity in world spacez
- z velocity in world space
-
nullifyFallDistance
void nullifyFallDistance()Reset fall distance of this entity.
This is used to stop the entity from taking fall damage. -
movePassenger
void movePassenger(org.bukkit.entity.Entity entity, double x, double y, double z) Synced method for moving a rider of this entity to the correct location- Parameters:
entity
- rider on this entityx
- x coordinatey
- y coordinatez
- z coordinate
-
isOnGround
boolean isOnGround()Get the true ground state of this entity.
This is necessary since the default ground state obtain throughEntity.isOnGround()
is forcefully set to true to maintain consistent movement speed. -
getSpeed
float getSpeed()Get the value of the movement speed attribute of this entity. -
getVelocity
org.bukkit.util.Vector getVelocity()Get the current velocity of this entity.
-