public interface Entity
Modifier and Type | Method and Description |
---|---|
void |
applyProperties(EntityProperties properties)
Sets the properties of this entity to the specified properties
|
BoundingBox |
boundingBox()
Returns the bounding box of the entity
|
String |
displayName()
Gets the display name for the entity, used on inventories and deaths
|
void |
eject()
Removes the mounted entity, if there are any
|
int |
entityId()
The identifier for this entity for runtime, see uniqueId for a set id of the entity
|
boolean |
isNameVisible()
Gets if the entity's display name visible
|
boolean |
isSilent()
Gets if the entity is silent (sounds)
|
boolean |
onGround()
Checks if the entity is currently on the ground, or at least touching the ground
|
Entity |
passenger()
Gets the entity that is riding this entity, if there is any
|
Position |
position()
The position of the entity with respect to the coordinate grid
|
void |
remove()
Removes the entity from the world and destroys it, freeing all memory associated with it
|
void |
setDisplayName(String name)
Sets the entity's display name, effects inventories (if applicable) and death messages
|
void |
setPassenger(Entity entity)
Mounts the specified entity on this entity
|
void |
setSize(float width,
float height)
Set the width and height of the entity
|
void |
setVelocity(Vector vector)
Sets the entity's movement direction and speed to the magnitude of the vector
|
void |
teleport(double x,
double y,
double z)
Moves the entity to the specified position
|
void |
teleport(Entity entity)
Moves the current entity to the provided entity's position
|
void |
teleport(Position position)
Moves the entity to the coordinates specified by the position object passed in
|
EntityType |
type()
Gets the type of entity
|
UUID |
uniqueId()
The unique id for the entity to the server
|
Vector |
velocity()
The direction and movement magnitude of the entity
|
Set<Entity> |
withinRange(double radius)
Gets the entities that are within proximity to this entity
|
World |
world()
The world which the entity resides in
|
void teleport(double x, double y, double z)
x
- the x coordinate of the positiony
- the y coordinate of the positionz
- the z coordinate of the positionvoid teleport(Entity entity)
entity
- the entity to move the current entity tovoid teleport(Position position)
position
- the position to move the entity toWorld world()
Position position()
Vector velocity()
void setVelocity(Vector vector)
vector
- the vector to set the entity velocity toboolean onGround()
true
if the entity touches the ground, false
if it is in the air (such as if it was
falling)Set<Entity> withinRange(double radius)
radius
- the spherical radius to look for entities aroundString displayName()
void setDisplayName(String name)
name
- Entity nameboolean isNameVisible()
boolean isSilent()
int entityId()
uniqueId()
UUID uniqueId()
void remove()
Entity passenger()
null
if there are nonevoid setPassenger(Entity entity)
entity
- the entity to set passenger to this entityvoid eject()
EntityType type()
void applyProperties(EntityProperties properties)
properties
- the properties to setvoid setSize(float width, float height)
width
- Width of entityheight
- Height of entityBoundingBox boundingBox()
Copyright © 2016. All rights reserved.