Script API - v1.21.0
    Preparing search index...

    Contains objectives and participants for the scoreboard.

    Index

    Methods

    • 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");
    • 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");
    • 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");