Contains objectives and participants for the scoreboard.

Methods

  • Beta

    Parameters

    • objectiveId: string
    • OptionaldisplayName: string

    Returns ScoreboardObjective

    Adds a new objective to the scoreboard.

    This function can't be called in read-only mode.

    This function can throw errors.

    import { world } from "@minecraft/server";

    world.scoreboard.addObjective("example", "example");
  • Beta

    Parameters

    • objectiveId: string

      Identifier of the objective.

    Returns ScoreboardObjective

    Returns a specific objective (by id).

    import { world } from "@minecraft/server";

    const money = world.scoreboard.getObjective("money");
  • Beta

    Parameters

    Returns boolean

    Removes an objective from the scoreboard.

    This function can't be called in read-only mode.

    This function can throw errors.

    import { world } from "@minecraft/server";

    world.scoreboard.removeObjective("money");