Living

Undocumented in source.

Constructors

this
this(World world, EntityPosition position, uint health, uint max)
Undocumented in source.

Members

Functions

addEffect
bool addEffect(sul.effects.Effect effect, ubyte level, tick_t duration, Living thrower)

Adds an effect to the entity.

addEffect
bool addEffect(Effect effect)
Undocumented in source. Be warned that the author may not have intended to support it.
attackImpl
void attackImpl(EntityDamageEvent event)
Undocumented in source. Be warned that the author may not have intended to support it.
callDeathEvent
EntityDeathEvent callDeathEvent(EntityDamageEvent last)
Undocumented in source. Be warned that the author may not have intended to support it.
clearEffects
bool clearEffects()

Removes every effect.

die
void die()

Die and send the packets to the viewers

heal
void heal(EntityHealEvent event)
Undocumented in source. Be warned that the author may not have intended to support it.
healthUpdated
void healthUpdated()
Undocumented in source. Be warned that the author may not have intended to support it.
onEffectAdded
void onEffectAdded(Effect effect, bool modified)
Undocumented in source. Be warned that the author may not have intended to support it.
onEffectRemoved
void onEffectRemoved(Effect effect)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinaryRight
Effect* opBinaryRight(ubyte id)
Effect* opBinaryRight(sul.effects.Effect effect)

Gets a pointer to an effect.

recalculateColors
void recalculateColors()
Undocumented in source. Be warned that the author may not have intended to support it.
recalculateSpeed
void recalculateSpeed()
Undocumented in source. Be warned that the author may not have intended to support it.
removeEffect
bool removeEffect(sul.effects.Effect effect)
bool removeEffect(ubyte effect)

Removes an effect from the entity.

tick
void tick()
Undocumented in source. Be warned that the author may not have intended to support it.
validateAttack
bool validateAttack(EntityDamageEvent event)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

absorption
uint absorption [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
alive
bool alive [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
dead
bool dead [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
despawnAfter
tick_t despawnAfter [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
health
uint health [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
health
uint health [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
healthNoAbs
uint healthNoAbs [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
maxAbsorption
uint maxAbsorption [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
maxHealth
uint maxHealth [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
maxHealth
uint maxHealth [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
maxHealthNoAbs
uint maxHealthNoAbs [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
potionAmbient
bool potionAmbient [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
potionColor
Color potionColor [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
speed
float speed [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

effects
Effect[ubyte] effects;
Undocumented in source.
immortal
bool immortal;
Undocumented in source.
last_received_attack
tick_t last_received_attack;
Undocumented in source.
last_void_damage
tick_t last_void_damage;
Undocumented in source.
m_health
Health m_health;
Undocumented in source.

Inherited Members

From Entity

reserveLocalId
uint reserveLocalId()
Undocumented in source. Be warned that the author may not have intended to support it.
_id
uint _id;
Undocumented in source.
n_uuid
UUID n_uuid;
Undocumented in source.
n_world
World n_world;
Undocumented in source.
ticking
bool ticking;
Undocumented in source.
n_alive
bool n_alive;
Undocumented in source.
oldposition
EntityPosition oldposition;
Undocumented in source.
m_position
EntityPosition m_position;
Undocumented in source.
m_last
EntityPosition m_last;
Undocumented in source.
m_motion
EntityPosition m_motion;
Undocumented in source.
m_yaw
float m_yaw;
Undocumented in source.
m_body_yaw
float m_body_yaw;
Undocumented in source.
m_pitch
float m_pitch;
Undocumented in source.
moved
bool moved;
Undocumented in source.
motionmoved
bool motionmoved;
Undocumented in source.
n_on_ground
bool n_on_ground;
Undocumented in source.
last_puncher
Entity last_puncher;
Undocumented in source.
n_eye_height
double n_eye_height;
Undocumented in source.
n_box
EntityAxis n_box;
Undocumented in source.
metadata
Metadata metadata;
Undocumented in source.
n_data
uint n_data;
Undocumented in source.
acceleration
float acceleration;
Undocumented in source.
drag
float drag;
Undocumented in source.
terminal_velocity
float terminal_velocity;
Undocumented in source.
id
uint id [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
data
sul.entities.Entity data [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
type
string type [@property getter]

Gets the entity's type in a string format.

java
bool java [@property getter]

Indicates whether the entity exists in Minecraft.

javaId
ubyte javaId [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
bedrock
bool bedrock [@property getter]

Indicates whether the entity exists in Minecraft.

bedrockId
ubyte bedrockId [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
width
double width [@property getter]

Gets the item's width.

height
double height [@property getter]

Gets the item's height.

object
bool object [@property getter]

Indicates whether the entity is an object. If not the entity is a mob (living entity).

objectData
int objectData [@property getter]

If the entity is an object gets the object's extra data used in Minecraft's SpawnObject packet.

uuid
UUID uuid [@property getter]

Gets the unique identifier (UUID). It's usually randomly generated when the entity is created and it can only be changed by the child classes.

world
World world [@property getter]

Gets the world the entity has been spawned into. Non-player entities should always have the same world for their whole life-cycle.

server
shared(NodeServer) server [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
tick
void tick()
Undocumented in source. Be warned that the author may not have intended to support it.
ticks
tick_t ticks [@property getter]

Gets the amount of ticks for this entity. The ticks doesn't indicates the life-time of the entity, but how many times it has been ticked by its world.

onFire
bool onFire [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
onFire
bool onFire [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
sneaking
bool sneaking [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
sneaking
bool sneaking [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
sprinting
bool sprinting [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
sprinting
bool sprinting [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
usingItem
bool usingItem [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
actionFlag
bool actionFlag [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
invisible
bool invisible [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
invisible
bool invisible [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
nametag
string nametag [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
nametag
string nametag [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
showNametag
bool showNametag [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
showNametag
bool showNametag [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
noai
bool noai [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
noai
bool noai [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
shouldSee
bool shouldSee(Entity entity)

Indicates which entities this one should and should not see. By default only the entities indicated as true by this function will be shown through the <a href="#Entity.show">show</a> function and added to the watchlist. For example, an arrow can see a painting, so Arrow.shouldSee(painting) will be true, but a painting shouldn't see an arrow, so Painting.shouldSee(arrow) will be false. This increases the performances as there are less controls, casts and operation on arrays in big worlds or chunks of worlds with an high concetration of entities.

show
bool show(Entity entity)

Adds an entity to the ones this entity can see.

sees
bool sees(Entity entity)

Checks wether this entity can see or not another entity.

hide
bool hide(Entity entity)

Hides an entity from this entity, if this entity can see it.

watchlist
T[] watchlist [@property getter]

Gets a list of the entities that this entity can see.

viewers
T[] viewers [@property getter]

Gets a list of the entities that can see this entity.

despawn
void despawn()

Despawns this entity, calling the event in the world.

setAsDespawned
void setAsDespawned()
Undocumented in source. Be warned that the author may not have intended to support it.
alive
bool alive [@property getter]
dead
bool dead [@property getter]

Checks the dead/alive status of the entity.

chunk
ChunkPosition chunk [@property getter]

Gets the 16x16 chunk the entity is in. A bigger chunk can be obtained by right-shifting the vector by the required amount.

position
EntityPosition position [@property getter]

Gets the entity's position.

motion
EntityPosition motion [@property getter]

Gets the entity's motion.

motion
EntityPosition motion [@property setter]

Sets the entity's motion.

motionless
bool motionless [@property getter]

Checks whether or not an entity has motion. A motionless entity has every value of the motion's vector equal to 0.

motionless
bool motionless [@property setter]

Sets the entity as motionless. This is equivalent to motion = EntityPosition(0).

velocity
Vector3!short velocity [@property getter]

Gets the motion as pc's velocity, ready to be encoded in a packet. Due to this encoding limitation, the entity's motion should never be higher than 4.096 (2^15 / 8000). If it is, it will be clamped.

yaw
float yaw [@property getter]

Gets the entity's looking direction (right-left). The value should always be in range 0..360.

angleYaw
ubyte angleYaw [@property getter]

Gets the yaw as an unsigned byte for encoding reasons. To obtain a valid value the yaw should be in its valid range from 0 to 360.

bodyYaw
float bodyYaw [@property getter]

Gets the entity's body facing direction. This variable may not affect all the entities.

angleBodyYaw
ubyte angleBodyYaw [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
pitch
float pitch [@property getter]

Gets the entity's looking direction (up-down). The value should be in range -90..90 (90 included).

anglePitch
byte anglePitch [@property getter]

Gets the pitch as a byte for encoding reasons. To btain a valid value the pitch should be in its valid range from -90 to 90.

onGround
bool onGround [@property getter]

Boolean value indicating whether or not the player is touching the ground or is in it. This value is true even if the player is in a liquid (like water).

direction
EntityPosition direction [@property getter]

Gets the player's looking direction calculated from yaw and pitch. The return value is in range 0..1 and it should be multiplied to obtain the desired value.

move
void move(EntityPosition position)

Moves the entity.

move
void move(EntityPosition position, float yaw, float pitch)
Undocumented in source. Be warned that the author may not have intended to support it.
move
void move(EntityPosition position, float yaw, float bodyYaw, float pitch)
Undocumented in source. Be warned that the author may not have intended to support it.
teleport
void teleport(EntityPosition position)
void teleport(EntityPosition position, float yaw, float pitch)
void teleport(EntityPosition position, float yaw, float bodyYaw, float pitch)
void teleport(World world, EntityPosition position)
void teleport(World world, EntityPosition position, float yaw, float pitch)
void teleport(World world, EntityPosition position, float yaw, float bodyYaw, float pitch)
void teleport(Position position)
void teleport(Position position, float yaw, float pitch)
void teleport(Position position, float yaw, float bodyYaw, float pitch)
void teleport(World world, Position position)
void teleport(World world, Position position, float yaw, float pitch)
void teleport(World world, Position position, float yaw, float bodyYaw, float pitch)

Teleports the entity.

eyeHeight
double eyeHeight [@property getter]

Gets entity's sizes.

updateGroundStatus
void updateGroundStatus()

Does the onGround updates.

doFallDamage
void doFallDamage(float distance, float modifier)
Undocumented in source. Be warned that the author may not have intended to support it.
falling
bool falling [@property getter]

Boolean value indicating whether or not the entity is falling.

doPhysic
void doPhysic()

Does physic movements using the entity's parameters.

checkCollisionsWithEntities
void checkCollisionsWithEntities()

Checks collisions with the entities in the watchlist and calls onCollideWithEntity on collision.

onCollideWithEntity
bool onCollideWithEntity(Entity entity)

Function called from checkCollisionWithEntities when this entity collides with another entity.

checkCollisionsWithBlocks
void checkCollisionsWithBlocks()
Undocumented in source. Be warned that the author may not have intended to support it.
onCollideWithBlock
bool onCollideWithBlock(Block block, BlockPosition position, uint face)
Undocumented in source. Be warned that the author may not have intended to support it.
setSize
void setSize(float width, float height)

Updates the size of the entity and its bounding box.

box
EntityAxis box [@property getter]

Gets the entity's bounding box.

scale
float scale [@property getter]

/** * Gets the entity's width. */ public final @property @safe @nogc float width() { return this.box.width; }

scale
float scale [@property setter]
Undocumented in source. Be warned that the author may not have intended to support it.
vehicle
Entity vehicle [@property getter]

Gets the entity's vechicle.

vehicle
Entity vehicle [@property setter]

Sets the entity's vehicle.

passenger
Entity passenger [@property getter]

Gets the entity's passenger.

passenger
Entity passenger [@property setter]

Sets the entity's passenger. The vehicle of the passenger is set automatically.

attack
T attack(T event)

Attacks an entity and returns the event used.

validateAttack
bool validateAttack(EntityDamageEvent event)
Undocumented in source. Be warned that the author may not have intended to support it.
attackImpl
void attackImpl(EntityDamageEvent event)
Undocumented in source. Be warned that the author may not have intended to support it.
broadcastMetadata
void broadcastMetadata()

Send the metadata to the viewers

drop
void drop(Slot slot)

Drop an item from this entity

name
string name [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
displayName
string displayName [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Object o)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta