endstone::Objective
Represents an objective on a scoreboard that can show scores specific to entries.
Functions:
Name | Description |
---|---|
getCriteria | Gets the criteria this objective tracks. |
getDisplayName | Gets the name displayed to players for this objective. |
getDisplaySlot | Gets the display slot this objective is displayed at. |
getName | Gets the name of this Objective . |
getRenderType | |
getScore | Sets manner in which this objective will be rendered. |
getScoreboard | Gets the scoreboard to which this objective is attached. |
getSortOrder | Gets the sort order for this objective. |
isDisplayed | Gets if the objective is currently displayed in a slot. |
isModifiable | Gets if the objective’s scores can be modified directly by a plugin. |
setDisplay | Sets the display slot and sort order for this objective. This will remove it from any other display slot. |
setDisplayName | Sets the name displayed to players for this objective. |
setDisplaySlot | Sets the display slot for this objective. This will remove it from any other display slot. |
setSortOrder | Sets the sort order for this objective. |
unregister | Unregisters this objective from the associated Scoreboard . |
getCriteria
Result<const Criteria *> getCriteria() const
Gets the criteria this objective tracks.
Returns:
this objective’s criteria.
getDisplayName
Result<std::string> getDisplayName() const
Gets the name displayed to players for this objective.
Returns:
this objective’s display name
getDisplaySlot
Result<DisplaySlot> getDisplaySlot() const
Gets the display slot this objective is displayed at.
Returns:
the display slot for this objective
getName
Result<std::string> getName() const
Gets the name of this Objective .
Returns:
this objective’s name
getRenderType
Result<RenderType> getRenderType() const
Gets manner in which this objective will be rendered.
Returns:
the render type
getScore
Result<std::unique_ptr<Score>> getScore(ScoreEntry entry) const
Sets manner in which this objective will be rendered.
Parameters:
render_type
new render type
Gets an entry’s Score for this objective.
Parameters:
entry
Entry for the Score
Returns:
Score tracking the Objective and entry specified
getScoreboard
Scoreboard &getScoreboard() const
Gets the scoreboard to which this objective is attached.
Returns:
Owning scoreboard
getSortOrder
Result<ObjectiveSortOrder> getSortOrder() const
Gets the sort order for this objective.
Returns:
The sort order for this objective.
isDisplayed
Result<bool> isDisplayed() const
Gets if the objective is currently displayed in a slot.
Returns:
true if the objective is displayed
isModifiable
Result<bool> isModifiable() const
Gets if the objective’s scores can be modified directly by a plugin.
Returns:
true if scores are modifiable
setDisplay
Result<void> setDisplay(std::optional<DisplaySlot> slot,
ObjectiveSortOrder order)
Sets the display slot and sort order for this objective. This will remove it from any other display slot.
Parameters:
slot
The display slot where this objective should be displayed.order
The sort order for this objective in the display slot.
setDisplayName
Result<void> setDisplayName(std::string display_name)
Sets the name displayed to players for this objective.
Parameters:
display_name
Display name to set
setDisplaySlot
Result<void> setDisplaySlot(std::optional<DisplaySlot> slot)
Sets the display slot for this objective. This will remove it from any other display slot.
Parameters:
slot
The display slot where this objective should be displayed.
setSortOrder
Result<void> setSortOrder(ObjectiveSortOrder order)
Sets the sort order for this objective.
Parameters:
order
The sort order for this objective in the display slot.
unregister
Result<void> unregister() const
Unregisters this objective from the associated Scoreboard .