- attack
T attack(T event)
Attacks an entity and returns the event used.
- 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
- checkCollisionsWithBlocks
void checkCollisionsWithBlocks()
Undocumented in source. Be warned that the author may not have intended to support it.
- checkCollisionsWithEntities
void checkCollisionsWithEntities()
Checks collisions with the entities in the watchlist
and calls onCollideWithEntity on collision.
- despawn
void despawn()
Despawns this entity, calling the event in the world.
- doFallDamage
void doFallDamage(float distance, float modifier)
Undocumented in source. Be warned that the author may not have intended to support it.
- doPhysic
void doPhysic()
Does physic movements using the entity's parameters.
- drop
void drop(Slot slot)
Drop an item from this entity
- hide
bool hide(Entity entity)
Hides an entity from this entity, if this entity can see it.
- move
void move(EntityPosition position)
- 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.
- onCollideWithBlock
bool onCollideWithBlock(Block block, BlockPosition position, uint face)
Undocumented in source. Be warned that the author may not have intended to support it.
- onCollideWithEntity
bool onCollideWithEntity(Entity entity)
Function called from checkCollisionWithEntities when
this entity collides with another entity.
- opEquals
bool opEquals(Object o)
Undocumented in source. Be warned that the author may not have intended to support it.
- sees
bool sees(Entity entity)
Checks wether this entity can see or not another entity.
- setAsDespawned
void setAsDespawned()
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.
- 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.
- 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)
- tick
void tick()
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.
- updateGroundStatus
void updateGroundStatus()
Does the onGround updates.
- validateAttack
bool validateAttack(EntityDamageEvent event)
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.
- alive
bool alive [@property getter]
Checks the dead/alive status of the entity.
- angleBodyYaw
ubyte angleBodyYaw [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- 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.
- 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.
- 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.
- bodyYaw
float bodyYaw [@property getter]
Gets the entity's body facing direction. This variable
may not affect all the entities.
- box
EntityAxis box [@property getter]
Gets the entity's bounding box.
- 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.
- data
sul.entities.Entity data [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- dead
bool dead [@property getter]
Checks the dead/alive status of the entity.
- 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.
- displayName
string displayName [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- eyeHeight
double eyeHeight [@property getter]
- falling
bool falling [@property getter]
Boolean value indicating whether or not the entity
is falling.
- height
double height [@property getter]
- id
uint id [@property getter]
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.
- 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.
- 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).
- name
string name [@property getter]
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.
- 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.
- 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.
- 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.
- 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).
- 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.
- pitch
float pitch [@property getter]
Gets the entity's looking direction (up-down).
The value should be in range -90..90 (90 included).
- position
EntityPosition position [@property getter]
Gets the entity's position.
- 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.
- server
shared(NodeServer) server [@property getter]
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.
- 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.
- 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.
- type
string type [@property getter]
Gets the entity's type in a string format.
- usingItem
bool usingItem [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
- 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.
- vehicle
Entity vehicle [@property getter]
Gets the entity's vechicle.
- vehicle
Entity vehicle [@property setter]
Sets the entity's vehicle.
- 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.
- viewers
T[] viewers [@property getter]
Gets a list of the entities that can see this entity.
- watchlist
T[] watchlist [@property getter]
Gets a list of the entities that this entity can see.
- width
double width [@property getter]
- 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.
- yaw
float yaw [@property getter]
Gets the entity's looking direction (right-left).
The value should always be in range 0..360.
Base abstract class for every entity.