public interface Entity
| Modifier and Type | Method and Description |
|---|---|
default <C extends EntityComponent> |
ensureAndGet(Class<C> clazz) |
<C extends EntityComponent> |
get(Class<C> clazz) |
BoundingBox |
getBoundingBox() |
default com.flowpowered.math.vector.Vector3f |
getDirectionVector() |
long |
getEntityId()
Returns a unique id for this entity
|
com.flowpowered.math.vector.Vector3f |
getGamePosition() |
float |
getHeight()
Gets the entity's height
|
Level |
getLevel()
Gets the current world this entity resides in
|
com.flowpowered.math.vector.Vector3f |
getMotion()
Gets this entity's current velocity
|
float |
getOffset() |
com.flowpowered.math.vector.Vector3f |
getPosition() |
Rotation |
getRotation() |
Server |
getServer()
Gets the
Server that contains this Entity |
long |
getTickCreated() |
long |
getTicksLived()
Gets the amount of ticks this entity has lived for.
|
UUID |
getUniqueId() |
Optional<Entity> |
getVehicle()
Get the vehicle that this player is inside.
|
float |
getWidth()
Gets the entity's width
|
boolean |
isAffectedByGravity() |
boolean |
isAlive()
Returns true if this entity has been marked for removal.
|
boolean |
isCustomNameVisible()
Gets whether or not the mob's custom name is displayed client side.
|
boolean |
isGlowing()
Gets whether the entity is glowing or not.
|
boolean |
isInsideVehicle()
Returns whether this entity is inside a vehicle.
|
boolean |
isInvulnerable()
Gets whether the entity is invulnerable or not.
|
boolean |
isOnGround()
Returns true if the entity is supported by a block.
|
boolean |
isSneaking()
Gets whether the entity is silent or not.
|
boolean |
leaveVehicle()
Leave the current vehicle.
|
Set<Class<? extends EntityComponent>> |
providedComponents() |
<C extends EntityComponent> |
provides(Class<C> clazz) |
void |
remove()
Mark the entity for removal.
|
void |
setAffectedByGravity(boolean affectedByGravity) |
void |
setCustomNameVisible(boolean flag)
Sets whether or not to display the mob's custom name client side.
|
void |
setGlowing(boolean flag)
Sets whether the entity has a team colored (default: white) glow.
|
void |
setInvulnerable(boolean flag)
Sets whether the entity is invulnerable or not.
|
void |
setMotion(com.flowpowered.math.vector.Vector3f velocity)
Sets this entity's velocity
|
void |
setPosition(com.flowpowered.math.vector.Vector3f position) |
void |
setPositionFromSystem(com.flowpowered.math.vector.Vector3f position) |
void |
setSneaking(boolean sneaking)
Sets whether the entity is silent or not.
|
void |
setTickCreated(long tickCreated) |
void |
setTicksLived(long ticksLived)
Sets the amount of ticks this entity has lived for.
|
boolean |
teleport(Entity destination)
Teleports this entity to the target Entity.
|
boolean |
teleport(com.flowpowered.math.vector.Vector3f position)
Teleports this entity to the given position.
|
boolean |
teleport(com.flowpowered.math.vector.Vector3f location,
Level level)
Teleports this entity to the given position in level.
|
@Nonnull com.flowpowered.math.vector.Vector3f getMotion()
UUID getUniqueId()
@Nonnull com.flowpowered.math.vector.Vector3f getPosition()
void setPosition(@Nonnull com.flowpowered.math.vector.Vector3f position)
void setPositionFromSystem(@Nonnull com.flowpowered.math.vector.Vector3f position)
@Nonnull com.flowpowered.math.vector.Vector3f getGamePosition()
@Nonnull BoundingBox getBoundingBox()
void setMotion(com.flowpowered.math.vector.Vector3f velocity)
velocity - New velocity to travel withfloat getHeight()
float getWidth()
float getOffset()
boolean isOnGround()
Level getLevel()
boolean teleport(com.flowpowered.math.vector.Vector3f position)
position - New location to teleport this entity totrue if the teleport was successfulboolean teleport(com.flowpowered.math.vector.Vector3f location,
Level level)
location - New location to teleport this entity tolevel - Level to teleport totrue if the teleport was successfulboolean teleport(Entity destination)
destination - Entity to teleport this entity totrue if the teleport was successfullong getEntityId()
void remove()
boolean isAlive()
@Nonnull Server getServer()
Server that contains this Entitylong getTickCreated()
void setTickCreated(long tickCreated)
long getTicksLived()
This is the equivalent to "age" in entities.
void setTicksLived(long ticksLived)
This is the equivalent to "age" in entities. May not be less than one tick.
ticksLived - Age of entityboolean isInsideVehicle()
boolean leaveVehicle()
Optional<Entity> getVehicle()
boolean isCustomNameVisible()
This value has no effect on players, they will always display their name.
void setCustomNameVisible(boolean flag)
This value has no effect on players, they will always display their name.
flag - custom name or notboolean isGlowing()
void setGlowing(boolean flag)
flag - if the entity is glowingboolean isInvulnerable()
void setInvulnerable(boolean flag)
When an entity is invulnerable it can only be damaged by players in creative mode.
flag - if the entity is invulnerableboolean isSneaking()
void setSneaking(boolean sneaking)
When an entity is silent it will not produce any sound.
sneaking - if the entity is silentboolean isAffectedByGravity()
void setAffectedByGravity(boolean affectedByGravity)
default com.flowpowered.math.vector.Vector3f getDirectionVector()
Set<Class<? extends EntityComponent>> providedComponents()
<C extends EntityComponent> boolean provides(Class<C> clazz)
<C extends EntityComponent> Optional<C> get(Class<C> clazz)
default <C extends EntityComponent> C ensureAndGet(Class<C> clazz)
Copyright © 2017–2018 NukkitX. All rights reserved.