Class PlayerActor

Class to manipulate with separate players.

It is temporary! Most methods works only 1 server tick!

Constructors

Methods

  • Add experience to player.

    Parameters

    • amount: number

    Returns void

  • Adds item to player's inventory.

    Parameters

    • id: number
    • count: number
    • data: number
    • extra: ItemExtraData
    • dropRemaining: boolean

      if true, surplus will be dropped near player

    Returns void

  • Returns number

    ID of dimension where player is.

  • Returns number

    2.2.1b101 (TODO: fix in changelog)

  • Returns number

    2.2.1b101 (TODO: fix in changelog)

  • Returns number

    2.2.1b101 (TODO: fix in changelog)

  • Gets one of the player's abilities in a boolean form.

    Parameters

    • ability: string

      ability name constant, should be one of the EPlayerAbility constants

    Returns boolean

    Current value of the ability in a boolean form.

    Server-side analogue of Player.getBooleanAbility.

    2.3.1b116

  • Gets one of the player's abilities in a form of floating-point number.

    Parameters

    • ability: string

      ability name constant, should be one of the EPlayerAbility constants

    Returns number

    Current value of the ability in a form of floating-point number.

    Server-side analogue of Player.getFloatAbility.

    2.3.1b116

  • Returns number

    Player's unique numeric entity ID.

  • Returns boolean

    true if player has operator permissions

    2.3.1b116

  • Returns boolean

    Whether the player is a valid entity.

    2.2.0b75 (not working before)

  • Sets armor slot's contents.

    Parameters

    • slot: number
    • id: number
    • count: number
    • data: number
    • extra: ItemExtraData

    Returns void

  • Enables or disables player's ability to fly.

    Parameters

    • enabled: boolean

      whether the player can fly or not

    Returns void

    2.3.1b116

    Server-side analogue of Player.setFlyingEnabled.

  • Sets player's exhaustion.

    Parameters

    • value: number

    Returns void

  • Sets player's experience.

    Parameters

    • value: number

    Returns void

  • Changes player's current flying state, call PlayerActor.setCanFly to be able to set this property to true.

    Parameters

    • enabled: boolean

      whether the player should fly or not

    Returns void

    2.3.1b116

    Server-side analogue of Player.setFlying.

  • Sets player's hunger.

    Parameters

    • value: number

    Returns void

  • Sets inventory slot's contents.

    Parameters

    • slot: number
    • id: number
    • count: number
    • data: number
    • extra: ItemExtraData

    Returns void

  • Sets player's xp level.

    Parameters

    • level: number

    Returns void

  • Sets some of the player's abilities.

    Parameters

    • ability: string

      ability name constant, should be one of the EPlayerAbility constants

    • value: boolean

      the value to be set for the ability

    Returns void

    Server-side analogue of Player.setAbility.

    2.3.1b116

  • Sets some of the player's abilities.

    Parameters

    • ability: string

      ability name constant, should be one of the EPlayerAbility constants

    • value: number

      the value to be set for the ability

    Returns void

    Server-side analogue of Player.setAbility.

    2.3.1b116

  • Sets respawn coords for the player.

    Parameters

    • x: number
    • y: number
    • z: number

    Returns void

  • Sets player's saturation.

    Parameters

    • value: number

    Returns void

  • Sets player's score.

    Parameters

    • value: number

    Returns void

  • Sets player's selected slot.

    Parameters

    • slot: number

    Returns void

  • Spawns exp on coords.

    Parameters

    • x: number
    • y: number
    • z: number
    • value: number

      experience points value

    Returns void

Copyright © 2024 Nernar. Copyright © 2020 #mineprogramming. Built with ❤ and TypeDoc.