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, world
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
displayName, lastDamageEvent, lastPlayerDamager
applyProperties, boundingBox, eject, entityId, isNameVisible, isSilent, onGround, passenger, position, setDisplayName, setPassenger, setSize, setVelocity, teleport, teleport, teleport, type, uniqueId, velocity, withinRange, world
protected 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 TridentEntity
protected void doTick()
doTick
in class TridentEntity
public double health()
LivingEntity
health
in interface LivingEntity
public void setHealth(double health)
LivingEntity
setHealth
in interface LivingEntity
health
- health of the Entitypublic double maxHealth()
LivingEntity
maxHealth
in interface LivingEntity
public void setMaxHealth(double maxHealth)
LivingEntity
maxHealth cannot be above the current health of the Entity
setMaxHealth
in interface LivingEntity
maxHealth
- maximum health of the Entitypublic Position headLocation()
LivingEntity
headLocation
in interface LivingEntity
public long remainingAir()
LivingEntity
remainingAir
in interface LivingEntity
public void setRemainingAir(long ticks)
LivingEntity
setRemainingAir
in interface LivingEntity
ticks
- long amount of remaining air in tickspublic boolean canCollectItems()
LivingEntity
canCollectItems
in interface LivingEntity
public boolean isDead()
LivingEntity
instanceof
LivingEntity
isDead
in interface LivingEntity
true
if the entity is dead, false
if it is alivepublic void remove()
Entity
remove
in interface Entity
remove
in class TridentEntity
public void setAiModule(AiModule module)
LivingEntity
setAiModule
in interface LivingEntity
public AiModule aiModule()
LivingEntity
aiModule
in interface LivingEntity
public <T extends Projectile> T launchProjectile(EntityProperties properties)
ProjectileLauncher
launchProjectile
in interface ProjectileLauncher
public void performAiUpdate()
public Path path()
LivingEntity
path
in interface LivingEntity
public void setPath(Path path)
LivingEntity
setPath
in interface LivingEntity
public void hide(Entity entity)
LivingEntity
Has no effect if the current entity is not a player
hide
in interface LivingEntity
entity
- the entity to make invisible to this entitypublic void show(Entity entity)
LivingEntity
Has no effect if the current entity is not a player
show
in interface LivingEntity
entity
- the entity to make visible to this entitypublic void load(CompoundTag tag)
load
in class TridentEntity
public EntityStatusEffect createStatusEffect(EntityStatusEffectType status)
LivingEntity
createStatusEffect
in interface LivingEntity
status
- The status to applyCopyright © 2016. All rights reserved.