endstone.scoreboard
Classes relating to manage the client side score display system.
Classes relating to manage the client side score display system.
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. |
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
| Name | Description |
|---|---|
Type | Represents a scoreboard criteria. |
Attributes
| Name | Type | Description |
|---|---|---|
DUMMY | The dummy criteria. Not changed by the server. | |
default_render_type | RenderType | |
is_read_only | bool | |
name | str |
attrDUMMY
DUMMYThe dummy criteria. Not changed by the server.
attrdefault_render_typeproperty
default_render_type: RenderTypeattris_read_onlyproperty
is_read_only: boolattrnameproperty
name: strclassType
Bases: Enum
Type()Represents a scoreboard criteria.
Attributes
| Name | Type | Description |
|---|---|---|
DUMMY | The dummy criteria. Not changed by the server. |
attrDUMMY
DUMMY = 0The dummy criteria. Not changed by the server.
classDisplaySlot
Bases: Enum
DisplaySlot()Locations for displaying objectives to the player
Attributes
| Name | Type | Description |
|---|---|---|
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 = 0Displays the score below the player's name.
attrPLAYER_LIST
PLAYER_LIST = 1Displays the score in the player list on the pause screen.
attrSIDE_BAR
SIDE_BAR = 2Displays 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
| 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 or sets 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 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 or sets the sort order for this objective |
attrcriteriaproperty
criteria: CriteriaGets the criteria this objective tracks
attrdisplay_nameproperty
display_name: strGets or sets the name displayed to players for this objective
attrdisplay_slotproperty
display_slot: DisplaySlot | NoneGets or sets the display slot this objective is displayed at
attris_displayedproperty
is_displayed: boolGets if the objective is currently displayed in a slot.
attris_modifiableproperty
is_modifiable: boolGets if the objective's scores can be modified directly by a plugin
attrnameproperty
name: strGets the name of this Objective
attrrender_typeproperty
render_type: RenderTypeGets the manner in which this objective will be rendered.
attrscoreboardproperty
scoreboard: ScoreboardGets the scoreboard to which this objective is attached
attrsort_orderproperty
sort_order: ObjectiveSortOrder | NoneGets or sets the sort order for this objective
methget_score
Gets an entry's Score for this objective
methset_display
set_display(slot: DisplaySlot | None, order: ObjectiveSortOrder = ObjectiveSortOrder.ASCENDING) -> NoneSets the display slot and sort order for this objective. This will remove it from any other display slot.
methunregister
unregister() -> NoneUnregisters this objective from the associated Scoreboard.
classObjectiveSortOrder
Bases: Enum
ObjectiveSortOrder()Represents the sort order of objectives on a DisplaySlot.
Attributes
| Name | Type | Description |
|---|---|---|
ASCENDING | Sorts the objectives in the ascending order | |
DESCENDING | Sorts the objectives in the descending order |
attrASCENDING
ASCENDING = 0Sorts the objectives in the ascending order
attrDESCENDING
DESCENDING = 1Sorts the objectives in the descending order
classRenderType
Bases: Enum
RenderType()Controls the way in which an Objective is rendered on the client side.
classScore
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. |
attrentryproperty
Gets the entry being tracked by this Score
attris_score_setproperty
is_score_set: boolShows if this score has been set at any point in time.
attrobjectiveproperty
objective: ObjectiveGets the Objective being tracked by this Score.
attrscoreboardproperty
scoreboard: ScoreboardGets the scoreboard for the associated objective.
attrvalueproperty
value: intGets or sets the current score.
classScoreboard
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_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
attrentriesproperty
Gets all entries tracked by this Scoreboard
attrobjectivesproperty
Gets all Objectives on this Scoreboard
methadd_objective
add_objective(name: str, criteria: Type, display_name: str | None = None, render_type: RenderType = RenderType.INTEGER) -> ObjectiveRegisters an Objective on this Scoreboard with a name displayed to players
methclear_slot
clear_slot(slot: DisplaySlot) -> NoneClears any objective in the specified slot
methget_objectives_by_criteria
Gets all Objectives of a Criteria on the Scoreboard
methget_scores
Gets all scores for an entry on this Scoreboard
methreset_scores
Removes all scores for an entry on this Scoreboard