Script API - v1.19.80
    Preparing search index...

    Represents the state of an entity (a mob, the player, or other moving objects like minecarts) in the world.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    dimension: Dimension

    Dimension that the entity is currently within.

    This property can throw when used.

    id: string

    Unique 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.

    location: Vector3

    Current location of the entity.

    This property can throw when used.

    nameTag: string

    Given name of the entity.

    This property can't be edited in read-only mode.

    typeId: string

    Unique identifier of the type of the entity - for example, 'minecraft:skeleton'.

    This property can throw when used.

    Methods

    • Returns Vector3

      Returns the current location of the head component of this entity.

      This function can't be called in read-only mode.

      This function can throw errors.

    • Returns Vector3

      Returns the current velocity vector of the entity.

      This function can't be called in read-only mode.

      This function can throw errors.

    • Returns Vector3

      Returns the current view direction of the entity.

      This function can't be called in read-only mode.

      This function can throw errors.

    • Parameters

      • commandString: string

        Command to run. Note that command strings should not start with slash.

      Returns Promise<CommandResult>

      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't be called in read-only mode.

      This function can throw errors.