Skip to Content
⚠ Under Construction
ReferenceC++ APIScoreboard

endstone::Scoreboard

Represents a scoreboard.

Bases: std::enable_shared_from_this< Scoreboard >

Functions:

NameDescription
addObjectiveRegisters an Objective on this Scoreboard .
addObjectiveRegisters an Objective on this Scoreboard .
addObjectiveRegisters an Objective on this Scoreboard .
clearSlotClears any objective in the specified slot.
getEntriesGets all entries tracked by this Scoreboard .
getObjectiveGets an Objective on this Scoreboard by name.
getObjectiveGets the Objective currently displayed in a DisplaySlot on this Scoreboard .
getObjectivesGets all Objectives on this Scoreboard .
getObjectivesByCriteriaGets all Objectives of a Criteria on the Scoreboard .
getScoresGets all scores for an entry on this Scoreboard .
resetScoresRemoves all scores for an entry on this Scoreboard .

addObjective

Result<std::unique_ptr<Objective>> addObjective(std::string name, Criteria::Type criteria)

Registers an Objective on this Scoreboard .

Parameters:

Returns:

A reference to the newly registered Objective.

Result<std::unique_ptr<Objective>> addObjective(std::string name, Criteria::Type criteria, std::string display_name)

Registers an Objective on this Scoreboard .

Parameters:

Returns:

A reference to the newly registered Objective.

Result<std::unique_ptr<Objective>> addObjective(std::string name, Criteria::Type criteria, std::string display_name, RenderType render_type)

Registers an Objective on this Scoreboard .

Parameters:

Returns:

A reference to the newly registered Objective.

clearSlot

void clearSlot(DisplaySlot slot)

Clears any objective in the specified slot.

Parameters:

  • slot the slot to remove objectives

getEntries

std::vector<ScoreEntry> getEntries() const

Gets all entries tracked by this Scoreboard .

Returns:

A list of all tracked entries

getObjective

std::unique_ptr<Objective> getObjective(std::string name) const

Gets an Objective on this Scoreboard by name.

Parameters:

Returns:

the Objective or nullptr if it does not exist

std::unique_ptr<Objective> getObjective(DisplaySlot slot) const

Gets the Objective currently displayed in a DisplaySlot on this Scoreboard .

Parameters:

Returns:

the Objective currently displayed or nullptr if nothing is displayed in that DisplaySlot

getObjectives

std::vector<std::unique_ptr<Objective>> getObjectives() const

Gets all Objectives on this Scoreboard .

Returns:

A list of all Objectives on this Scoreboard

getObjectivesByCriteria

std::vector<std::unique_ptr<Objective>> getObjectivesByCriteria(Criteria::Type criteria) const

Gets all Objectives of a Criteria on the Scoreboard .

Parameters:

Returns:

A list of Objectives using the specified Criteria

getScores

std::vector<std::unique_ptr<Score>> getScores(ScoreEntry entry) const

Gets all scores for an entry on this Scoreboard .

Parameters:

  • entry the entry whose scores are being retrieved

Returns:

a list of all scores tracked for the entry

resetScores

void resetScores(ScoreEntry entry)

Removes all scores for an entry on this Scoreboard .

Parameters:

  • entry the entry to drop all current scores for
Last updated on