public abstract class TridentLivingEntity extends TridentEntity implements LivingEntity
| Modifier and Type | Field and Description |
|---|---|
protected List<EntityAttribute> |
attributes |
protected boolean |
canPickup
Whether the entity can pick up items
|
protected boolean |
dead
Whether the entity is dead
|
protected com.google.common.util.concurrent.AtomicDouble |
health
The entity health
|
protected AtomicInteger |
invincibilityTicks |
protected double |
maxHealth
The maximum available health
|
protected AtomicInteger |
restTicks |
airTicks, boundingBox, counter, displayName, executor, fallDistance, fireTicks, godMode, HANDLER, height, id, loc, nameVisible, onGround, passenger, portalCooldown, silent, ticksExisted, uniqueId, velocity, width| Constructor and Description |
|---|
TridentLivingEntity(UUID id,
Position spawnLocation)
Inherits from
TridentEntity |
| Modifier and Type | Method and Description |
|---|---|
static AiHandler |
aiHandler() |
AiModule |
aiModule()
Gets the AI Module for this class, which will be the default if there is no special AI that has been defined for
this entity
|
boolean |
canCollectItems()
Returns if the Entity can pickup items
|
EntityStatusEffect |
createStatusEffect(EntityStatusEffectType status)
Creates a new entity status effect
|
protected void |
doTick() |
protected void |
encodeMetadata(ProtocolMetadata protocolMeta) |
Position |
headLocation()
Returns the position of the Entity's eye
|
double |
health()
Returns the health of the Entity
|
void |
hide(Entity entity)
Makes the specified entity invisible to the current entity
|
boolean |
isDead()
Checks if the entity has died, or has 0 health.
|
<T extends Projectile> |
launchProjectile(EntityProperties properties)
Launch a projectile based on the given EntityProperties
|
void |
load(CompoundTag tag) |
double |
maxHealth()
Returns the maximum health of the Entity
|
Path |
path()
Gets the path that this entity is currently following
|
void |
performAiUpdate() |
long |
remainingAir()
Returns the amount of remaining air for the Entity
|
void |
remove()
Removes the entity from the world and destroys it, freeing all memory associated with it
|
void |
setAiModule(AiModule module)
Overides defaults and previous AI Modules for this entity, assigning a new module to it
|
void |
setHealth(double health)
Sets the health of the Entity
|
void |
setMaxHealth(double maxHealth)
Sets the maximum health of the Entity
|
void |
setPath(Path path)
Sets a path for this entity to follow, should only be used in an AiHandler
|
void |
setRemainingAir(long ticks)
Sets the amount of remaining air for the LivingAir
|
void |
show(Entity entity)
Un-hides the entity that was hidden from view, or does nothing of already visible
|
applyProperties, asNbt, boundingBox, displayName, doEncodeMeta, doLoad, doRemove, eject, entityId, isNameVisible, isSilent, onGround, passenger, position, setDisplayName, setOnGround, setPassenger, setPosition, setSize, setVelocity, spawn, teleport, teleport, teleport, tick, type, uniqueId, velocity, withinRange, worldclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdisplayName, lastDamageEvent, lastPlayerDamagerapplyProperties, boundingBox, eject, entityId, isNameVisible, isSilent, onGround, passenger, position, setDisplayName, setPassenger, setSize, setVelocity, teleport, teleport, teleport, type, uniqueId, velocity, withinRange, worldprotected final List<EntityAttribute> attributes
protected final AtomicInteger invincibilityTicks
protected final AtomicInteger restTicks
protected final com.google.common.util.concurrent.AtomicDouble health
protected volatile boolean dead
protected volatile boolean canPickup
protected volatile double maxHealth
public TridentLivingEntity(UUID id, Position spawnLocation)
TridentEntity
The entity is immediately set "non-dead" after super call
protected void encodeMetadata(ProtocolMetadata protocolMeta)
encodeMetadata in class TridentEntityprotected void doTick()
doTick in class TridentEntitypublic double health()
LivingEntityhealth in interface LivingEntitypublic void setHealth(double health)
LivingEntitysetHealth in interface LivingEntityhealth - health of the Entitypublic double maxHealth()
LivingEntitymaxHealth in interface LivingEntitypublic void setMaxHealth(double maxHealth)
LivingEntitymaxHealth cannot be above the current health of the Entity
setMaxHealth in interface LivingEntitymaxHealth - maximum health of the Entitypublic Position headLocation()
LivingEntityheadLocation in interface LivingEntitypublic long remainingAir()
LivingEntityremainingAir in interface LivingEntitypublic void setRemainingAir(long ticks)
LivingEntitysetRemainingAir in interface LivingEntityticks - long amount of remaining air in tickspublic boolean canCollectItems()
LivingEntitycanCollectItems in interface LivingEntitypublic boolean isDead()
LivingEntityinstanceof LivingEntityisDead in interface LivingEntitytrue if the entity is dead, false if it is alivepublic void remove()
Entityremove in interface Entityremove in class TridentEntitypublic void setAiModule(AiModule module)
LivingEntitysetAiModule in interface LivingEntitypublic AiModule aiModule()
LivingEntityaiModule in interface LivingEntitypublic <T extends Projectile> T launchProjectile(EntityProperties properties)
ProjectileLauncherlaunchProjectile in interface ProjectileLauncherpublic void performAiUpdate()
public Path path()
LivingEntitypath in interface LivingEntitypublic void setPath(Path path)
LivingEntitysetPath in interface LivingEntitypublic void hide(Entity entity)
LivingEntityHas no effect if the current entity is not a player
hide in interface LivingEntityentity - the entity to make invisible to this entitypublic void show(Entity entity)
LivingEntityHas no effect if the current entity is not a player
show in interface LivingEntityentity - the entity to make visible to this entitypublic void load(CompoundTag tag)
load in class TridentEntitypublic EntityStatusEffect createStatusEffect(EntityStatusEffectType status)
LivingEntitycreateStatusEffect in interface LivingEntitystatus - The status to applyCopyright © 2016. All rights reserved.