Skip to content

Scoreboard

Data Type

An object used for getting the score of a score holder from a scoreboard objective.

Note

If the score holder referenced in the name field does not exist, the data type will return a value of 0.

Fields

Field Type Default Description
name String The name of the score holder or a target selector.
objective String The name of the scoreboard objective.

Examples

"score": {
    "name": "aTestScoreHolder",
    "objective": "example"
}

This example will get the score of the aTestScoreHolder score holder from the example scoreboard objective.

"score": {
    "name": "#hiddenScoreHolder",
    "objective": "example"
}

This example will get the score of the #hiddenScoreHolder score holder from the example scoreboard objective.

"score": {
    "name": "@e[tag = test, limit = 1]",
    "objective": "example"
}

This example will get the score of the entity that has the test tag from the example scoreboard objective.