Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • MBCPlayer

Index

Accessors

  • get dimension(): Dimension
  • get inventory(): EntityInventoryComponent
  • get name(): string
  • get player(): Player
  • get position(): Vector3
  • get prevVelocity(): Vector3
  • get uid(): string
  • get velocity(): Vector3

Methods

  • getDirectionVectors(): { direction: Vector3; origin: Vector3 }
  • Gets a direction Vector3 based on the player's facing direction

    throws

    If command fails to return position (may be due to unloaded chunks)

    deprecated

    Use player.viewVector instead

    Returns { direction: Vector3; origin: Vector3 }

    Normalized Direction Vector3

    • direction: Vector3
    • origin: Vector3
  • getRotation(dir?: Vector): Vector2
  • Gets the player's current rotation based on the direction vector. Fetches current direction vector if none is supplied.

    Parameters

    • dir: Vector = ...

    Returns Vector2

    A Vector2 containing the rotation in degrees

  • getTags(): string[]
  • getTargetBlock(raycastParams?: BlockRaycastOptions): Block
  • The block the player is currently looking at

    Parameters

    • Optional raycastParams: BlockRaycastOptions

    Returns Block

  • getTargetEntity(raycastParams?: EntityRaycastOptions): Entity
  • The entity the player is currently looking at

    Parameters

    • Optional raycastParams: EntityRaycastOptions

    Returns Entity

  • isAlive(): boolean
  • Checks whether the player is alive or not

    Returns boolean

    A boolean representing whether the player is alive or not

  • isOnline(): boolean
  • Checks whether the player is online or not

    Returns boolean

    A boolean representing whether the player is online or not

  • sendMessage(msg: string): void
  • setTags(tags: string[]): void
  • setVelocity(velocity: Vector): void
  • Gets the MBCPlayer class for the specified player name

    Parameters

    • name: string

      A string representing the player's name

    Returns MBCPlayer

    An MBCPlayer class representing the specified player

  • Gets the MBCPlayer class for the specified player name

    Parameters

    • player: Player

      A Player class representing the target player

    Returns MBCPlayer

    An MBCPlayer class representing the specified player

  • Gets the MBCPlayer class for the specified player uid

    Parameters

    • uid: string

      A string representing the player's uid

    Returns MBCPlayer

    An MBCPlayer class representing the specified player

Generated using TypeDoc version 0.22.18, the 7/5/2022