Class Bossbar

Represent a bossbar

Hierarchy

  • Bossbar

Constructors

Properties

Methods

Constructors

Properties

edit: { color: ((content: mcDefaultColors) => string); display: ((content: JsonRaw) => string); max: ((value: number) => string); update: (() => string[]); value: ((value: number) => string); visible: ((entity?: false | Entity) => string[] | "bossbar modify visible false") } = ...

Edit the bossbar's properties

Type declaration

  • color: ((content: mcDefaultColors) => string)
  • display: ((content: JsonRaw) => string)
      • (content: JsonRaw): string
      • How the player will see the bossbar's name

        Parameters

        • content: JsonRaw

          Json formated text

        Returns string

  • max: ((value: number) => string)
      • (value: number): string
      • The maximum value of the bossbar

        Parameters

        • value: number

        Returns string

  • update: (() => string[])
      • (): string[]
      • Update the bossbar with every property in one time

        Returns string[]

  • value: ((value: number) => string)
      • (value: number): string
      • Set the bossbar's value

        Parameters

        • value: number

        Returns string

  • visible: ((entity?: false | Entity) => string[] | "bossbar modify visible false")
      • (entity?: false | Entity): string[] | "bossbar modify visible false"
      • Set the bossbar's visibility

        Parameters

        • Optional entity: false | Entity

          The entity that can see the bossbar (if the value is false or undefined, the bossbar will be invisible for everyone)

        Returns string[] | "bossbar modify visible false"

id: string
settings: bbOptions
store: { max: ((type: "success" | "result", from: string) => string); value: ((type: "success" | "result", from: string) => string) } = ...

Store a value to the bossbar

Type declaration

  • max: ((type: "success" | "result", from: string) => string)
      • (type: "success" | "result", from: string): string
      • Store the execution's result into the maximum bossbar's value

        Parameters

        • type: "success" | "result"

          The type of result you want:

          success: If the command has been correcly executed, it will returns 1, else 0

          result: Will returns the callback of the executed command

        • from: string

          The command to get the result

        Returns string

  • value: ((type: "success" | "result", from: string) => string)
      • (type: "success" | "result", from: string): string
      • Store the execution's result into the bossbar's value

        Parameters

        • type: "success" | "result"

          The type of result you want:

          success: If the command has been correcly executed, it will returns 1, else 0

          result: Will returns the callback of the executed command

        • from: string

          The command to get the result

        Returns string

Methods

  • Get a value of the bossbar

    Parameters

    • type: "value" | "max" | "players" | "visible" | "bossbars"

      The data of the bossbar's you want:
      max: The maximum value of the bossbar
      players: The players who can see the bossbar
      value: The current bossbar's value
      visible: If the bossbar is visible or not
      bossbars: The list of all the bossbars

    Returns string

Generated using TypeDoc