Skip to Content
⚠ Under Construction
ReferenceC++ APIBossBar

endstone::BossBar

Represents a boss bar that is displayed to players.

Functions:

NameDescription
addFlagAdd an optional flag to this boss bar.
addPlayerAdds the player to this boss bar causing it to display on their screen.
getColorReturns the color of this boss bar.
getPlayersReturns all players viewing this boss bar.
getProgressReturns the progress of the bar between 0.0 and 1.0.
getStyleReturns the style of this boss bar.
getTitleReturns the title of this boss bar.
hasFlagReturns whether this boss bar has the passed flag set.
isVisibleReturn if the boss bar is displayed to attached players.
removeAllRemoves all players from this boss bar.
removeFlagRemove an existing flag on this boss bar.
removePlayerRemoves the player from this boss bar causing it to be removed from their screen.
setColorSets the color of this boss bar.
setProgressSets the progress of the bar. Values should be between 0.0 (empty) and 1.0 (full)
setStyleSets the bar style of this boss bar.
setTitleSets the title of this boss bar.
setVisibleSet if the boss bar is displayed to attached players.

addFlag

void addFlag(BarFlag flag)

Add an optional flag to this boss bar.

Parameters:

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

addPlayer

void addPlayer(Player &player)

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

Parameters:

  • player the player to add

getColor

BarColor getColor() const

Returns the color of this boss bar.

Returns:

the color of the bar

getPlayers

std::vector<Player *> getPlayers() const

Returns all players viewing this boss bar.

Returns:

a list of players

getProgress

float getProgress() const

Returns the progress of the bar between 0.0 and 1.0.

Returns:

the progress of the bar

getStyle

BarStyle getStyle() const

Returns the style of this boss bar.

Returns:

the style of the bar.

getTitle

std::string getTitle() const

Returns the title of this boss bar.

Returns:

the title of the bar

hasFlag

bool hasFlag(BarFlag flag) const

Returns whether this boss bar has the passed flag set.

Parameters:

  • flag the flag to check.

Returns:

whether it has the flag.

isVisible

bool isVisible() const

Return if the boss bar is displayed to attached players.

Returns:

visible status

removeAll

void removeAll()

Removes all players from this boss bar.

removeFlag

void removeFlag(BarFlag flag)

Remove an existing flag on this boss bar.

Parameters:

  • flag the existing flag to remove.

removePlayer

void removePlayer(Player &player)

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

Parameters:

  • player the player to remove

setColor

void setColor(BarColor color)

Sets the color of this boss bar.

Parameters:

  • color the color of the bar

setProgress

Result<void> setProgress(float progress)

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

Parameters:

  • progress the progress of the bar

setStyle

void setStyle(BarStyle style)

Sets the bar style of this boss bar.

Parameters:

  • style the style of the bar.

setTitle

void setTitle(std::string title)

Sets the title of this boss bar.

Parameters:

  • title the title of the bar

setVisible

void setVisible(bool visible)

Set if the boss bar is displayed to attached players.

Parameters:

  • visible visible status
Last updated on