Represents a player within the world.

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

id: string

Unique identifier of the player. 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.

Throws

This property can throw when used.

name: string

Name of the player.

Throws

This property can throw when used.

typeId: string

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

Throws

This property can throw when used.

Methods

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

    Remarks

    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.

    Throws

    This function can throw errors.