endstone.scoreboard

Classes relating to manage the client side score display system.

Classes relating to manage the client side score display system.

Classes

NameDescription
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.

RenderType

Controls the way in which an Objective is rendered on the client side.

Score

Represents a score for an objective on a scoreboard.

Scoreboard

Represents a scoreboard

classCriteria

Criteria()

Represents a scoreboard criteria.

Classes

NameDescription
Type

Represents a scoreboard criteria.

Attributes

NameTypeDescription
DUMMY

The dummy criteria. Not changed by the server.

default_render_typeRenderType
is_read_onlybool
namestr

attrDUMMY

DUMMY

The dummy criteria. Not changed by the server.

attrdefault_render_typeproperty

default_render_type: RenderType

attris_read_onlyproperty

is_read_only: bool

attrnameproperty

name: str

classType

Bases: Enum

Type()

Represents a scoreboard criteria.

Attributes

NameTypeDescription
DUMMY

The dummy criteria. Not changed by the server.

attrDUMMY

DUMMY = 0

The dummy criteria. Not changed by the server.

classDisplaySlot

Bases: Enum

DisplaySlot()

Locations for displaying objectives to the player

Attributes

NameTypeDescription
BELOW_NAME

Displays the score below the player's name.

PLAYER_LIST

Displays the score in the player list on the pause screen.

SIDE_BAR

Displays the score on the side of the player's screen.

attrBELOW_NAME

BELOW_NAME = 0

Displays the score below the player's name.

attrPLAYER_LIST

PLAYER_LIST = 1

Displays the score in the player list on the pause screen.

attrSIDE_BAR

SIDE_BAR = 2

Displays the score on the side of the player's screen.

classObjective

Objective()

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

Methods

NameDescription
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

NameTypeDescription
criteriaCriteria

Gets the criteria this objective tracks

display_namestr

Gets or sets the name displayed to players for this objective

display_slotDisplaySlot | None

Gets or sets the display slot this objective is displayed at

is_displayedbool

Gets if the objective is currently displayed in a slot.

is_modifiablebool

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

namestr

Gets the name of this Objective

render_typeRenderType

Gets the manner in which this objective will be rendered.

scoreboardScoreboard

Gets the scoreboard to which this objective is attached

sort_orderObjectiveSortOrder | None

Gets or sets the sort order for this objective

attrcriteriaproperty

criteria: Criteria

Gets the criteria this objective tracks

attrdisplay_nameproperty

display_name: str

Gets or sets the name displayed to players for this objective

attrdisplay_slotproperty

display_slot: DisplaySlot | None

Gets or sets the display slot this objective is displayed at

attris_displayedproperty

is_displayed: bool

Gets if the objective is currently displayed in a slot.

attris_modifiableproperty

is_modifiable: bool

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

attrnameproperty

name: str

Gets the name of this Objective

attrrender_typeproperty

render_type: RenderType

Gets the manner in which this objective will be rendered.

attrscoreboardproperty

scoreboard: Scoreboard

Gets the scoreboard to which this objective is attached

attrsort_orderproperty

sort_order: ObjectiveSortOrder | None

Gets or sets the sort order for this objective

methget_score

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

Gets an entry's Score for this objective

methset_display

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

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

methunregister

unregister() -> None

Unregisters this objective from the associated Scoreboard.

classObjectiveSortOrder

Bases: Enum

ObjectiveSortOrder()

Represents the sort order of objectives on a DisplaySlot.

Attributes

NameTypeDescription
ASCENDING

Sorts the objectives in the ascending order

DESCENDING

Sorts the objectives in the descending order

attrASCENDING

ASCENDING = 0

Sorts the objectives in the ascending order

attrDESCENDING

DESCENDING = 1

Sorts the objectives in the descending order

classRenderType

Bases: Enum

RenderType()

Controls the way in which an Objective is rendered on the client side.

Attributes

NameTypeDescription
HEARTS
INTEGER

attrHEARTS

HEARTS = 1

attrINTEGER

INTEGER = 0

classScore

Score()

Represents a score for an objective on a scoreboard.

Attributes

NameTypeDescription
entryPlayer | Actor | str

Gets the entry being tracked by this Score

is_score_setbool

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

objectiveObjective

Gets the Objective being tracked by this Score.

scoreboardScoreboard

Gets the scoreboard for the associated objective.

valueint

Gets or sets the current score.

attrentryproperty

entry: Player | Actor | str

Gets the entry being tracked by this Score

attris_score_setproperty

is_score_set: bool

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

attrobjectiveproperty

objective: Objective

Gets the Objective being tracked by this Score.

attrscoreboardproperty

scoreboard: Scoreboard

Gets the scoreboard for the associated objective.

attrvalueproperty

value: int

Gets or sets the current score.

classScoreboard

Scoreboard()

Represents a scoreboard

Methods

NameDescription
add_objective

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

clear_slot

Clears any objective in the specified slot

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

NameTypeDescription
entrieslist[Player | Actor | str]

Gets all entries tracked by this Scoreboard

objectiveslist[Objective]

Gets all Objectives on this Scoreboard

attrentriesproperty

entries: list[Player | Actor | str]

Gets all entries tracked by this Scoreboard

attrobjectivesproperty

objectives: list[Objective]

Gets all Objectives on this Scoreboard

methadd_objective

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

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

methclear_slot

clear_slot(slot: DisplaySlot) -> None

Clears any objective in the specified slot

methget_objectives_by_criteria

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

Gets all Objectives of a Criteria on the Scoreboard

methget_scores

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

Gets all scores for an entry on this Scoreboard

methreset_scores

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

Removes all scores for an entry on this Scoreboard

On this page