Skip to content

Class endstone::BossBar

ClassList > endstone > BossBar

Represents a boss bar that is displayed to players.

  • #include <endstone/boss/boss_bar.h>

Public Functions

Type Name
virtual void addFlag (BarFlag flag) = 0
Add an optional flag to this boss bar.
virtual void addPlayer (Player & player) = 0
Adds the player to this boss bar causing it to display on their screen.
virtual BarColor getColor () const = 0
Returns the color of this boss bar.
virtual std::vector< Player * > getPlayers () const = 0
Returns all players viewing this boss bar.
virtual float getProgress () const = 0
Returns the progress of the bar between 0.0 and 1.0.
virtual BarStyle getStyle () const = 0
Returns the style of this boss bar.
virtual std::string getTitle () const = 0
Returns the title of this boss bar.
virtual bool hasFlag (BarFlag flag) const = 0
Returns whether this boss bar has the passed flag set.
virtual bool isVisible () const = 0
Return if the boss bar is displayed to attached players.
virtual void removeAll () = 0
Removes all players from this boss bar.
virtual void removeFlag (BarFlag flag) = 0
Remove an existing flag on this boss bar.
virtual void removePlayer (Player & player) = 0
Removes the player from this boss bar causing it to be removed from their screen.
virtual void setColor (BarColor color) = 0
Sets the color of this boss bar.
virtual Result< void > setProgress (float progress) = 0
Sets the progress of the bar. Values should be between 0.0 (empty) and 1.0 (full)
virtual void setStyle (BarStyle style) = 0
Sets the bar style of this boss bar.
virtual void setTitle (std::string title) = 0
Sets the title of this boss bar.
virtual void setVisible (bool visible) = 0
Set if the boss bar is displayed to attached players.
virtual ~BossBar () = default

Public Functions Documentation

function addFlag

Add an optional flag to this boss bar.

virtual void endstone::BossBar::addFlag (
    BarFlag flag
) = 0

Parameters:

  • flag an optional flag to set on the boss bar.

function addPlayer

Adds the player to this boss bar causing it to display on their screen.

virtual void endstone::BossBar::addPlayer (
    Player & player
) = 0

Parameters:

  • player the player to add

function getColor

Returns the color of this boss bar.

virtual BarColor endstone::BossBar::getColor () const = 0

Returns:

the color of the bar


function getPlayers

Returns all players viewing this boss bar.

virtual std::vector< Player * > endstone::BossBar::getPlayers () const = 0

Returns:

a list of players


function getProgress

Returns the progress of the bar between 0.0 and 1.0.

virtual float endstone::BossBar::getProgress () const = 0

Returns:

the progress of the bar


function getStyle

Returns the style of this boss bar.

virtual BarStyle endstone::BossBar::getStyle () const = 0

Returns:

the style of the bar.


function getTitle

Returns the title of this boss bar.

virtual std::string endstone::BossBar::getTitle () const = 0

Returns:

the title of the bar


function hasFlag

Returns whether this boss bar has the passed flag set.

virtual bool endstone::BossBar::hasFlag (
    BarFlag flag
) const = 0

Parameters:

  • flag the flag to check.

Returns:

whether it has the flag.


function isVisible

Return if the boss bar is displayed to attached players.

virtual bool endstone::BossBar::isVisible () const = 0

Returns:

visible status


function removeAll

virtual void endstone::BossBar::removeAll () = 0

function removeFlag

Remove an existing flag on this boss bar.

virtual void endstone::BossBar::removeFlag (
    BarFlag flag
) = 0

Parameters:

  • flag the existing flag to remove.

function removePlayer

Removes the player from this boss bar causing it to be removed from their screen.

virtual void endstone::BossBar::removePlayer (
    Player & player
) = 0

Parameters:

  • player the player to remove

function setColor

Sets the color of this boss bar.

virtual void endstone::BossBar::setColor (
    BarColor color
) = 0

Parameters:

  • color the color of the bar

function setProgress

Sets the progress of the bar. Values should be between 0.0 (empty) and 1.0 (full)

virtual Result< void > endstone::BossBar::setProgress (
    float progress
) = 0

Parameters:

  • progress the progress of the bar

function setStyle

Sets the bar style of this boss bar.

virtual void endstone::BossBar::setStyle (
    BarStyle style
) = 0

Parameters:

  • style the style of the bar.

function setTitle

Sets the title of this boss bar.

virtual void endstone::BossBar::setTitle (
    std::string title
) = 0

Parameters:

  • title the title of the bar

function setVisible

Set if the boss bar is displayed to attached players.

virtual void endstone::BossBar::setVisible (
    bool visible
) = 0

Parameters:

  • visible visible status

function ~BossBar

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


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