Skip to content

Scoreboard

endstone.scoreboard

Classes:

Name Description
Criteria

Represents a scoreboard criteria.

DisplaySlot

Locations for displaying objectives to the player

Objective

Represents an objective on a scoreboard that can show scores specific to entries.

ObjectiveSortOrder

Represents the sort order of objectives on a DisplaySlot.

Score

Represents a score for an objective on a scoreboard.

Scoreboard

Represents a scoreboard

Criteria

Represents a scoreboard criteria.

Classes:

Name Description
Type

Represents a scoreboard criteria.

Attributes:

Name Type Description
DUMMY Type
default_render_type RenderType
is_read_only bool
name str

DUMMY class-attribute

DUMMY: Type

default_render_type property

default_render_type: RenderType

is_read_only property

is_read_only: bool

name property

name: str

Type

Type(value: int)

Represents a scoreboard criteria.

Attributes:

Name Type Description
DUMMY Type
name str
value int
DUMMY class-attribute
DUMMY: Type
name property
name: str
value property
value: int

DisplaySlot

DisplaySlot(value: int)

Locations for displaying objectives to the player

Attributes:

Name Type Description
BELOW_NAME DisplaySlot
PLAYER_LIST DisplaySlot
SIDE_BAR DisplaySlot
name str
value int

BELOW_NAME class-attribute

BELOW_NAME: DisplaySlot

PLAYER_LIST class-attribute

PLAYER_LIST: DisplaySlot

SIDE_BAR class-attribute

SIDE_BAR: DisplaySlot

name property

name: str

value property

value: int

Objective

Represents an objective on a scoreboard that can show scores specific to entries.

Methods:

Name Description
get_score

Gets an entry's Score for this objective

set_display

Sets the display slot and sort order for this objective. This will remove it from any other display slot.

unregister

Unregisters this objective from the associated Scoreboard.

Attributes:

Name Type Description
criteria Criteria

Gets the criteria this objective tracks

display_name str

Gets or sets the name displayed to players for this objective

display_slot DisplaySlot | None

Gets the display slot this objective is displayed at

is_displayed bool

Gets if the objective is currently displayed in a slot.

is_modifiable bool

Gets if the objective's scores can be modified directly by a plugin

name str

Gets the name of this Objective

render_type RenderType

Gets and sets the manner in which this objective will be rendered.

scoreboard Scoreboard

Gets the scoreboard to which this objective is attached

sort_order ObjectiveSortOrder | None

Gets and sets the sort order for this objective

criteria property

criteria: Criteria

Gets the criteria this objective tracks

display_name property writable

display_name: str

Gets or sets the name displayed to players for this objective

display_slot property

display_slot: DisplaySlot | None

Gets the display slot this objective is displayed at

is_displayed property

is_displayed: bool

Gets if the objective is currently displayed in a slot.

is_modifiable property

is_modifiable: bool

Gets if the objective's scores can be modified directly by a plugin

name property

name: str

Gets the name of this Objective

render_type property writable

render_type: RenderType

Gets and sets the manner in which this objective will be rendered.

scoreboard property

scoreboard: Scoreboard

Gets the scoreboard to which this objective is attached

sort_order property

sort_order: ObjectiveSortOrder | None

Gets and sets the sort order for this objective

get_score

get_score(entry: Player | Actor | str) -> Score

Gets an entry's Score for this objective

set_display

set_display(
    slot: DisplaySlot | None,
    order: ObjectiveSortOrder | None = None,
) -> None

Sets the display slot and sort order for this objective. This will remove it from any other display slot.

unregister

unregister() -> None

Unregisters this objective from the associated Scoreboard.

ObjectiveSortOrder

ObjectiveSortOrder(value: int)

Represents the sort order of objectives on a DisplaySlot.

Attributes:

Name Type Description
ASCENDING ObjectiveSortOrder
DESCENDING ObjectiveSortOrder
name str
value int

ASCENDING class-attribute

ASCENDING: ObjectiveSortOrder

DESCENDING class-attribute

DESCENDING: ObjectiveSortOrder

name property

name: str

value property

value: int

Score

Represents a score for an objective on a scoreboard.

Attributes:

Name Type Description
entry Player | Actor | str

Gets the entry being tracked by this Score

is_score_set bool

Shows if this score has been set at any point in time.

objective Objective

Gets the Objective being tracked by this Score.

scoreboard Scoreboard

Gets the scoreboard for the associated objective.

value int

Gets or sets the current score.

entry property

entry: Player | Actor | str

Gets the entry being tracked by this Score

is_score_set property

is_score_set: bool

Shows if this score has been set at any point in time.

objective property

objective: Objective

Gets the Objective being tracked by this Score.

scoreboard property

scoreboard: Scoreboard

Gets the scoreboard for the associated objective.

value property writable

value: int

Gets or sets the current score.

Scoreboard

Represents a scoreboard

Methods:

Name Description
add_objective

Registers an Objective on this Scoreboard with a name displayed to players

clear_slot

Clears any objective in the specified slot

get_objective
get_objectives_by_criteria

Gets all Objectives of a Criteria on the Scoreboard

get_scores

Gets all scores for an entry on this Scoreboard

reset_scores

Removes all scores for an entry on this Scoreboard

Attributes:

Name Type Description
entries list[Player | Actor | str]

Gets all entries tracked by this Scoreboard

objectives list[Objective]

Gets all Objectives on this Scoreboard

entries property

entries: list[Player | Actor | str]

Gets all entries tracked by this Scoreboard

objectives property

objectives: list[Objective]

Gets all Objectives on this Scoreboard

add_objective

add_objective(
    name: str,
    criteria: Type,
    display_name: str | None = None,
    render_type: RenderType = INTEGER,
) -> Objective

Registers an Objective on this Scoreboard with a name displayed to players

clear_slot

clear_slot(slot: DisplaySlot) -> None

Clears any objective in the specified slot

get_objective

get_objective(name: str) -> Objective

Gets an Objective on this Scoreboard by name

get_objective(slot: DisplaySlot) -> Objective

Gets the Objective currently displayed in a DisplaySlot on this Scoreboard

get_objectives_by_criteria

get_objectives_by_criteria(
    criteria: Type,
) -> list[Objective]

Gets all Objectives of a Criteria on the Scoreboard

get_scores

get_scores(entry: Player | Actor | str) -> list[Score]

Gets all scores for an entry on this Scoreboard

reset_scores

reset_scores(entry: Player | Actor | str) -> None

Removes all scores for an entry on this Scoreboard