Protected
constructorReadonly
Beta
dimensionDimension that the entity is currently within.
This property can throw when used.
Readonly
idUnique identifier of the entity. This identifier is intended to be consistent across loads of a world instance. No meaning should be inferred from the value and structure of this unique identifier - do not parse or interpret it.
This property can throw when used.
Readonly
Beta
locationCurrent location of the entity.
This property can throw when used.
Beta
nameGiven name of the entity.
This property can't be edited in read-only mode.
Readonly
typeUnique identifier of the type of the entity - for example, 'minecraft:skeleton'.
This property can throw when used.
Beta
Content of the tag to add.
Returns true if the tag was added successfully. This can fail if the tag already exists on the entity.
Adds a specified tag to an entity.
This function can't be called in read-only mode.
This function can throw errors.
Beta
Amount of damage to apply.
Optional
options: EntityApplyDamageByProjectileOptions | EntityApplyDamageOptionsAdditional options about the source of damage, which may add additional effects or spur additional behaviors on this entity.
Whether the entity takes any damage. This can return false if the entity is invulnerable or if the damage applied is less than or equal to 0.
Applies a set of damage to an entity.
This function can't be called in read-only mode.
This function can throw errors.
Beta
Impulse vector.
Applies impulse vector to the current velocity of the entity.
This function can't be called in read-only mode.
This function can throw errors.
Beta
X direction in horizontal plane.
Z direction in horizontal plane.
Knockback strength for the horizontal vector.
Knockback strength for the vertical vector.
Applies impulse vector to the current velocity of the entity.
This function can't be called in read-only mode.
This function can throw errors.
Beta
The identifier of the component (e.g., 'minecraft:rideable') to retrieve. If no namespace prefix is specified, 'minecraft:' is assumed. If the component is not present on the entity, undefined is returned.
Returns the component if it exists on the entity, otherwise undefined.
Gets a component (that represents additional capabilities) for an entity.
Beta
Returns all components that are both present on this entity and supported by the API.
Returns all components that are both present on this entity and supported by the API.
Beta
The identifier of the component (e.g., 'minecraft:rideable') to retrieve. If no namespace prefix is specified, 'minecraft:' is assumed.
Returns true if the specified component is present on this entity.
Returns true if the specified component is present on this entity.
Beta
The command string. Note: This should not include a leading forward slash.
A command result containing whether the command was successful.
Runs a synchronous command on the entity.
This function can't be called in read-only mode.
This function can throw errors.
Command to run. Note that command strings should not start with slash.
For commands that return data, returns a JSON structure with command response values.
Runs a particular command asynchronously from the context of this entity. Note that there is a maximum queue of 128 asynchronous commands that can be run in a given tick.
This function can throw errors.
Represents the state of an entity (a mob, the player, or other moving objects like minecarts) in the world.