Hierarchy

  • default
    • Player

Constructors

  • Player's constructor.

    Parameters

    • connection: default
    • world: default
    • server: Server

    Returns Player

Properties

cacheSupport: boolean
currentChunk: null | default
device: null | default
gamemode: number
headYaw: number
locale: string
pitch: number
platformChatId: string
randomId: number
skin: null | default
username: { name: string; prefix: string; suffix: string }

Type declaration

  • name: string
  • prefix: string
  • suffix: string
uuid: string
viewDistance: any
xuid: string
yaw: number
MOB_ID: string
runtimeIdCount: bigint

Methods

  • Compare an instance of Vector3 with another.

    Returns

    true if they're equal otherwise false.

    Parameters

    • vector: Vector3

      The Vector3 to compare to

    Returns boolean

  • Returns boolean

  • Deprecated

    Returns default

  • Returns default

  • Deprecated

    Parameters

    • propertyId: number
    • flagId: bigint

    Returns boolean

  • Returns string

  • Returns string

  • Returns default

  • Deprecated

    Returns default

  • Returns string

  • Beta

    Get entities within radius of current entity.

    Returns

    The entities within the specified radius sorted

    Parameters

    • radius: number

      number

    Returns Promise<Entity[]>

  • Beta

    Returns the nearest entity from the current entity.

    Remarks

    TODO: Customizable radius

    Parameters

    • Optional entities: Entity[]

      optional, the entities to compare the distance between

    Returns Entity[]

  • Returns string[]

  • Returns Player[]

  • Get the entity's position.

    Returns

    The entity's position

    Returns Vector3

  • Get the entity's runtime id.

    Returns bigint

  • Returns Server

  • Get entity type.

    Returns

    The entity's namespace ID.

    Returns string

  • Returns string

  • Returns default

  • Get the x coordinate.

    Returns

    The x coordinate's value

    Returns number

  • Returns string

  • Get the y coordinate.

    Returns

    The y coordinate's value

    Returns number

  • Get the z coordinate.

    Returns

    The z coordinate's value

    Returns number

  • Check if the entity is a console instance.

    Returns

    true if the entity is console-controlled otherwise false

    Returns boolean

  • Returns boolean

  • Returns boolean

  • Returns boolean

  • Check if the Player is an operator.

    Returns

    true if this player is an operator otherwise false.

    Returns boolean

  • Returns boolean

  • Returns boolean

  • Check if the Player is sprinting.

    Returns

    true if this player is sprinting otherwise false.

    Returns boolean

  • Parameters

    • Optional reason: string

    Returns Promise<void>

  • Serialize this Vector3 instance into a BinaryStream.

    Parameters

    • stream: default

      The network stream.

    Returns void

  • Fired when an entity collides with another entity.

    Parameters

    • entity: Entity

      the entity collided with

    Returns Promise<void>

  • Returns Promise<void>

  • Returns Promise<void>

  • Returns Promise<void>

  • Send a chat message to the client.

    Parameters

    • message: string

      the message

    • Optional type: TextType
    • Optional parameters: string[]
    • Optional needsTranslation: boolean

    Returns Promise<void>

  • Send the position to all the players in the same world.

    Returns Promise<void>

  • Returns Promise<void>

  • Returns Promise<void>

  • Parameters

    • chunk: default

    Returns void

  • Deprecated

    Parameters

    • propertyId: number
    • flagId: number
    • Optional value: boolean
    • Optional propertyType: FlagType

    Returns void

  • Parameters

    • flying: boolean

    Returns Promise<void>

  • Parameters

    • mode: number

    Returns Promise<void>

  • Deprecated

    Parameters

    • flagId: number
    • Optional value: boolean

    Returns void

  • Parameters

    • name: string

    Returns void

  • Parameters

    • val: boolean

    Returns Promise<void>

  • Set the position.

    Remarks

    This will notify the player's client about the position change.

    Parameters

    • position: Vector3

      The position

    • Optional type: MovementType

      The movement type

    Returns Promise<void>

  • Parameters

    • val: boolean

    Returns Promise<void>

  • Parameters

    • sprinting: boolean

    Returns Promise<void>

  • Change the player's current world.

    Parameters

    • world: default

      the new world

    Returns Promise<void>

  • Set the x position.

    Parameters

    • x: number

      The x coordinate

    • Optional suppress: boolean

      If true the client won't be notified about the position change

    Returns Promise<void>

  • Set the y position.

    Parameters

    • y: number

      The y coordinate

    • Optional suppress: boolean

      If true the client won't be notified about the position change

    Returns Promise<void>

  • Set the z position.

    Parameters

    • z: number

      The z coordinate

    • Optional suppress: boolean

      If true the client won't be notified about the position change

    Returns Promise<void>

  • Parameters

    • tick: number

    Returns Promise<void>

  • Deserialize a Vector3 from a BinaryStream.

    Parameters

    • stream: default

      The network stream.

    Returns Vector3

Generated using TypeDoc