@PossiblyThreadSafe public class TridentEntity extends Object implements Entity
| Modifier and Type | Field and Description |
|---|---|
protected AtomicLong |
airTicks
How many ticks of air the entity has left
|
protected BoundingBox |
boundingBox
TODO
|
protected static AtomicInteger |
counter |
protected String |
displayName
The name of the entity appearing above the head
|
protected SelectableThreadPool |
executor
Entity task executor
|
protected com.google.common.util.concurrent.AtomicDouble |
fallDistance
The distance the entity has fallen
|
protected AtomicInteger |
fireTicks
How long the entity has been on fire
|
protected boolean |
godMode
true to indicate the entity cannot be damaged |
static EntityHandler |
HANDLER
Internal entity tracker, used to spawn the entity and track movement, etc.
|
protected float |
height
TODO
|
protected int |
id
The entity ID for the entity
|
protected Position |
loc
The entity location
|
protected boolean |
nameVisible
Whether or not the name of the entity is visible
|
protected boolean |
onGround
Whether or not the entity is touching the ground
|
protected Entity |
passenger
The entity's passenger, if there are any
|
protected AtomicInteger |
portalCooldown
Length of time the entity must wait to enter a portal.
|
protected boolean |
silent
TODO
|
protected AtomicLong |
ticksExisted
The ticks that have passed since the entity was spawned, and alive
|
protected UUID |
uniqueId
The identifier UUID for the entity
|
protected Vector |
velocity
The movement vector for the entity
|
protected float |
width
TODO
|
| Modifier | Constructor and Description |
|---|---|
protected |
TridentEntity()
Deprecated.
|
|
TridentEntity(UUID uniqueId,
Position spawnLocation)
Creates a new entity
|
| Modifier and Type | Method and Description |
|---|---|
void |
applyProperties(EntityProperties properties)
Sets the properties of this entity to the specified properties
|
CompoundTag |
asNbt() |
BoundingBox |
boundingBox()
Returns the bounding box of the entity
|
String |
displayName()
Gets the display name for the entity, used on inventories and deaths
|
protected void |
doEncodeMeta(ProtocolMetadata protocolMeta) |
protected void |
doLoad(CompoundTag tag) |
protected void |
doRemove() |
protected void |
doTick() |
void |
eject()
Removes the mounted entity, if there are any
|
protected void |
encodeMetadata(ProtocolMetadata protocolMeta) |
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)
|
void |
load(CompoundTag tag) |
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 |
setOnGround(boolean onGround) |
void |
setPassenger(Entity entity)
Mounts the specified entity on this entity
|
void |
setPosition(Position loc) |
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
|
TridentEntity |
spawn()
Begin entity management
|
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 location)
Moves the entity to the coordinates specified by the position object passed in
|
void |
tick() |
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
|
@InternalUseOnly protected static final AtomicInteger counter
public static final EntityHandler HANDLER
protected final com.google.common.util.concurrent.AtomicDouble fallDistance
protected final AtomicLong ticksExisted
protected final AtomicInteger fireTicks
protected final AtomicLong airTicks
protected final AtomicInteger portalCooldown
protected volatile int id
protected volatile SelectableThreadPool executor
protected volatile boolean onGround
protected volatile String displayName
protected volatile boolean nameVisible
protected volatile boolean silent
protected volatile boolean godMode
true to indicate the entity cannot be damagedprotected volatile BoundingBox boundingBox
protected volatile float width
protected volatile float height
public TridentEntity(UUID uniqueId, Position spawnLocation)
uniqueId - the UUID of the entityspawnLocation - the location which the entity is to be spawned@Deprecated protected TridentEntity()
protected void doTick()
protected void doRemove()
protected void doEncodeMeta(ProtocolMetadata protocolMeta)
protected void doLoad(CompoundTag tag)
public TridentEntity spawn()
protected void encodeMetadata(ProtocolMetadata protocolMeta)
public void teleport(double x, double y, double z)
Entitypublic void teleport(Entity entity)
Entitypublic void teleport(Position location)
Entitypublic World world()
Entitypublic Position position()
Entitypublic void setPosition(Position loc)
public Vector velocity()
Entitypublic void setVelocity(Vector vector)
EntitysetVelocity in interface Entityvector - the vector to set the entity velocity topublic String displayName()
EntitydisplayName in interface Entitypublic void setDisplayName(String name)
EntitysetDisplayName in interface Entityname - Entity namepublic boolean isSilent()
Entitypublic UUID uniqueId()
Entitypublic void tick()
public boolean onGround()
Entitypublic void setOnGround(boolean onGround)
public Set<Entity> withinRange(double radius)
EntitywithinRange in interface Entityradius - the spherical radius to look for entities aroundpublic int entityId()
EntityentityId in interface EntityEntity.uniqueId()public void remove()
Entitypublic Entity passenger()
Entitypublic void setPassenger(Entity entity)
EntitysetPassenger in interface Entityentity - the entity to set passenger to this entitypublic void eject()
Entitypublic EntityType type()
Entitypublic boolean isNameVisible()
EntityisNameVisible in interface Entitypublic void applyProperties(EntityProperties properties)
EntityapplyProperties in interface Entityproperties - the properties to setpublic void load(CompoundTag tag)
public CompoundTag asNbt()
public void setSize(float width, float height)
Entitypublic BoundingBox boundingBox()
EntityboundingBox in interface EntityCopyright © 2016. All rights reserved.