Skip to content

Class endstone::Objective

ClassList > endstone > Objective

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

  • #include <endstone/scoreboard/objective.h>

Public Functions

Type Name
virtual Result< const Criteria * > getCriteria () const = 0
Gets the criteria this objective tracks.
virtual Result< std::string > getDisplayName () const = 0
Gets the name displayed to players for this objective.
virtual Result< DisplaySlot > getDisplaySlot () const = 0
Gets the display slot this objective is displayed at.
virtual Result< std::string > getName () const = 0
Gets the name of this Objective .
virtual Result< RenderType > getRenderType () const = 0
virtual Result< std::unique_ptr< Score > > getScore (ScoreEntry entry) const = 0
Gets an entry's Score for this objective.
virtual Scoreboard & getScoreboard () const = 0
Gets the scoreboard to which this objective is attached.
virtual Result< ObjectiveSortOrder > getSortOrder () const = 0
Gets the sort order for this objective.
virtual Result< bool > isDisplayed () const = 0
Gets if the objective is currently displayed in a slot.
virtual Result< bool > isModifiable () const = 0
Gets if the objective's scores can be modified directly by a plugin.
virtual bool operator!= (const Objective & other) const = 0
virtual bool operator== (const Objective & other) const = 0
virtual Result< void > setDisplay (std::optional< DisplaySlot > slot) = 0
Sets the display slot for this objective. This will remove it from any other display slot.
virtual Result< void > setDisplay (std::optional< DisplaySlot > slot, ObjectiveSortOrder order) = 0
Sets the display slot and sort order for this objective. This will remove it from any other display slot.
virtual Result< void > setDisplayName (std::string display_name) = 0
Sets the name displayed to players for this objective.
virtual Result< void > setRenderType (RenderType render_type) = 0
Sets manner in which this objective will be rendered.
virtual Result< void > unregister () const = 0
Unregisters this objective from the associated Scoreboard .
virtual ~Objective () = default

Public Functions Documentation

function getCriteria

Gets the criteria this objective tracks.

virtual Result< const Criteria * > endstone::Objective::getCriteria () const = 0

Returns:

this objective's criteria.


function getDisplayName

Gets the name displayed to players for this objective.

virtual Result< std::string > endstone::Objective::getDisplayName () const = 0

Returns:

this objective's display name


function getDisplaySlot

Gets the display slot this objective is displayed at.

virtual Result< DisplaySlot > endstone::Objective::getDisplaySlot () const = 0

Returns:

the display slot for this objective


function getName

Gets the name of this Objective .

virtual Result< std::string > endstone::Objective::getName () const = 0

Returns:

this objective's name


function getRenderType

virtual Result< RenderType > endstone::Objective::getRenderType () const = 0

Gets manner in which this objective will be rendered.

Returns:

the render type


function getScore

Gets an entry's Score for this objective.

virtual Result< std::unique_ptr< Score > > endstone::Objective::getScore (
    ScoreEntry entry
) const = 0

Parameters:

  • entry Entry for the Score

Returns:

Score tracking the Objective and entry specified


function getScoreboard

Gets the scoreboard to which this objective is attached.

virtual Scoreboard & endstone::Objective::getScoreboard () const = 0

Returns:

Owning scoreboard


function getSortOrder

Gets the sort order for this objective.

virtual Result< ObjectiveSortOrder > endstone::Objective::getSortOrder () const = 0

Returns:

The sort order for this objective.


function isDisplayed

Gets if the objective is currently displayed in a slot.

virtual Result< bool > endstone::Objective::isDisplayed () const = 0

Returns:

true if the objective is displayed


function isModifiable

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

virtual Result< bool > endstone::Objective::isModifiable () const = 0

Returns:

true if scores are modifiable


function operator!=

virtual bool endstone::Objective::operator!= (
    const Objective & other
) const = 0

function operator==

virtual bool endstone::Objective::operator== (
    const Objective & other
) const = 0

function setDisplay [½]

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

virtual Result< void > endstone::Objective::setDisplay (
    std::optional< DisplaySlot > slot
) = 0

Parameters:

  • slot The display slot where this objective should be displayed.

function setDisplay [2/2]

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

virtual Result< void > endstone::Objective::setDisplay (
    std::optional< DisplaySlot > slot,
    ObjectiveSortOrder order
) = 0

Parameters:

  • slot The display slot where this objective should be displayed.
  • order The sort order for this objective in the display slot.

function setDisplayName

Sets the name displayed to players for this objective.

virtual Result< void > endstone::Objective::setDisplayName (
    std::string display_name
) = 0

Parameters:

  • display_name Display name to set

function setRenderType

Sets manner in which this objective will be rendered.

virtual Result< void > endstone::Objective::setRenderType (
    RenderType render_type
) = 0

Parameters:

  • render_type new render type

function unregister

virtual Result< void > endstone::Objective::unregister () const = 0

function ~Objective

virtual endstone::Objective::~Objective () = default


The documentation for this class was generated from the following file include/endstone/scoreboard/objective.h