Class: Scoreboard
Contains objectives and participants for the scoreboard.
Constructors
new Scoreboard()
private
new Scoreboard():Scoreboard
Returns
Methods
addObjective()
addObjective(
objectiveId
,displayName
?):ScoreboardObjective
Parameters
Parameter | Type |
---|---|
objectiveId | string |
displayName ? | string |
Returns
Remarks
Adds a new objective to the scoreboard.
This function can't be called in read-only mode.
Throws
This function can throw errors.
clearObjectiveAtDisplaySlot()
clearObjectiveAtDisplaySlot(
displaySlotId
):ScoreboardObjective
Parameters
Parameter | Type |
---|---|
displaySlotId | DisplaySlotId |
Returns
Remarks
Clears the objective that occupies a display slot.
This function can't be called in read-only mode.
getObjective()
getObjective(
objectiveId
):ScoreboardObjective
Parameters
Parameter | Type | Description |
---|---|---|
objectiveId | string | Identifier of the objective. |
Returns
Remarks
Returns a specific objective (by id).
getObjectiveAtDisplaySlot()
getObjectiveAtDisplaySlot(
displaySlotId
):ScoreboardObjectiveDisplayOptions
Parameters
Parameter | Type |
---|---|
displaySlotId | DisplaySlotId |
Returns
ScoreboardObjectiveDisplayOptions
Remarks
Returns an objective that occupies the specified display slot.
getObjectives()
getObjectives():
ScoreboardObjective
[]
Returns
Remarks
Returns all defined objectives.
getParticipants()
getParticipants():
ScoreboardIdentity
[]
Returns
Remarks
Returns all defined scoreboard identities.
removeObjective()
removeObjective(
objectiveId
):boolean
Parameters
Parameter | Type |
---|---|
objectiveId | string | ScoreboardObjective |
Returns
boolean
Remarks
Removes an objective from the scoreboard.
This function can't be called in read-only mode.
Throws
This function can throw errors.
setObjectiveAtDisplaySlot()
setObjectiveAtDisplaySlot(
displaySlotId
,objectiveDisplaySetting
):ScoreboardObjective
Parameters
Parameter | Type |
---|---|
displaySlotId | DisplaySlotId |
objectiveDisplaySetting | ScoreboardObjectiveDisplayOptions |
Returns
Returns the previous ScoreboardObjective
set at the
display slot, if no objective was previously set it returns
undefined
.
Remarks
Sets an objective into a display slot with specified additional display settings.
This function can't be called in read-only mode.
Throws
This function can throw errors.