The dimension to create the entity in
The type of the entity to create
Optional
properties: Partial<EntityProperties>Additional properties to assign to the entity
Readonly
attributesThe attributes that are attached to the entity These values are derived from the components and traits of the entity
The current dimension of the entity.
This should not be dynamically changed, but instead use the teleport
method.
Readonly
dynamicThe components that are attached to the entity
Readonly
flagsThe flags that are attached to the entity These values are derived from the components and traits of the entity
Readonly
identifierThe identifier of the entity.
Readonly
inputThe input info of the entity
Whether the entity is alive or not.
Whether the entity is falling or not.
Whether the entity is moving or not.
Whether the entity is currently ticking or not. If true, this means the behaviors of the entity are being processed. If false, this means the entity currently isn't within the simulation distance from a player.
Readonly
metadataThe metadata that is attached to the entity These values are derived from the components and traits of the entity
Whether the entity is on the ground or not.
Readonly
positionThe current position of the entity
Readonly
rotationThe current rotation of the entity
Readonly
runtimeThe current runtime id of the entity. (Incremented each time an entity is created)
The scoreboard identity of the entity.
Protected
Readonly
serenityThe serenity instance of the server
Readonly
sharedThe shared properties that are attached to the entity.
These properites are shared to the client to be used in resource pack elements.
They can also be queried via the molang
engine for use in resource packs.
Readonly
tagsThe tags that are attached to the entity
Readonly
traitsThe traits that are attached to the entity
Readonly
typeThe type of the entity.
Readonly
uniqueThe unique id of the entity. (Generated by the server, and exists for the lifetime of the entity)
Readonly
velocityThe current velocity of the entity
Static
runtimeThe running total of entities that have been created
Whether the entity name tag is always visible.
Whether the entity name tag is always visible.
Whether the entity is sneaking or not.
Whether the entity is sprinting or not.
Whether the entity is swimming or not.
The name tag of the entity.
The name tag of the entity
The scale of the entity.
The scale of the entity.
The variant index of the entity.
The variant index of the entity.
The current world the entity is in.
Adds a component to the entity.
The key of the component.
The value of the component.
Add's an effect to the entity.
The effect type that will be applied to the entity
The duration of the effect in seconds.
Optional
options: EntityEffectOptionsAdds motion to the entity.
The motion to add.
Adds a tag to the entity.
The tag to add.
Whether or not the tag was added.
Adds a trait to the entity.
The trait to add to the entity.
Optional
options: ConstructorParameters<T>[1]The additional options to pass to the trait.
The trait instance that was added to the entity.
Applies an impulse to the entity.
The impulse to apply.
Changes the dimension of the entity.
The dimension to change to.
Clears the motion of the entity.
Despawns the entity from the dimension.
Optional
options: Partial<EntityDespawnOptions>Forces the entity to drop an item from its inventory.
The slot to drop the item from.
The amount of items to drop.
The container to drop the item from.
Whether or not the item was dropped.
Executes a command as the entity.
The command to execute.
The response of the command.
Executes a command in the dimension asynchronously.
The command to execute.
The response of the command.
Gets the cardinal direction of the entity.
The cardinal direction of the entity.
Get a container from the entity.
The name of the container.
Optional
dynamicId: numberGets the specified component from the entity.
The key of the component.
The component if it exists, otherwise null.
Computes the entity's head location
Gets the item the entity is currently holding.
The item the entity is holding
Gets the selected inventory slot of the entity.
The selected hotbar index of the entity.
Get the shared property of the entity that is shared with the client.
The identifier of the property.
The value of the property.
Gets the tags of the entity.
The tags of the entity.
Gets the specified trait from the entity.
The trait to get from the entity
The trait if it exists, otherwise null
Gets the specified trait from the entity.
The trait to get from the entity
The trait if it exists, otherwise null
Computes the view direction vector based on the current pitch and yaw rotations.
A Vector3f representing the direction the view is pointing.
Whether the entity has the specified component.
The key of the component.
Whether the entity has the component or not.
Checks whether the entity has the effect or not.
The effect type to check if the entity has.
whether the entity has the effect or not.
Whether or not the entity has a tag.
The tag to check.
Whether or not the entity has the tag.
Whether the entity has the specified trait.
The trait to check for
Whether the entity has the trait
Causes a player to interact with the entity.
The player that is interacting with the entity.
The method that the player used to interact with the entity.
Checks if the entity is an item.
Whether or not the entity is an item.
Kills the entity.
Optional
options: Partial<EntityDeathOptions>The options for the entity death.
Loads the entity from the provided entity entry.
The world to the entity data is coming from
The entity entry to load
Whether to overwrite the current entity data; default is true
Removes the specified component from the entity.
The key of the component.
Removes an effect from the entity.
The effect type to remove from the entity
Removes a tag from the entity.
The tag to remove.
Whether or not the tag was removed.
Removes the specified trait from the entity.
The trait to remove
Sets the component of the entity.
The key of the component.
The value of the component.
Sets the position of the entity.
Optional
vector: Vector3fThe position to set.
Sets and sends the entity head rotation
The new entity's head rotation
Sets the shared property of the entity that is shared with the client.
The identifier of the property.
The value of the property.
Spawns the entity into the dimension.
Optional
options: Partial<EntitySpawnOptions>Teleport the entity to a new position.
The position to teleport the entity to.
Optional
dimension: DimensionThe dimension to teleport the entity to; optional.
Static
createCreates a new unique id for the entity.
The network id of the entity type
The current runtime id of the entity
A generated unique id for the entity
Creates a new entity within a dimension.