endstone/boss

Classes

NameDescription
BossBarRepresents a boss bar that is displayed to players.

Enums

classBossBar

Defined in <endstone/boss/boss_bar.h>

Represents a boss bar that is displayed to players.

Methods

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

meth~BossBarvirtual

~BossBar() =default

methgetTitleabstractconst

std::string getTitle() const =0

Returns the title of this boss bar.

Returns

TypeDescription
std::stringthe title of the bar

methsetTitleabstract

void setTitle(std::string title) =0

Sets the title of this boss bar.

Parameters

NameTypeDescription
titlestd::stringthe title of the bar

methgetColorabstractconst

BarColor getColor() const =0

Returns the color of this boss bar.

Returns

TypeDescription
BarColorthe color of the bar

methsetColorabstract

void setColor(BarColor color) =0

Sets the color of this boss bar.

Parameters

NameTypeDescription
colorBarColorthe color of the bar

methgetStyleabstractconst

BarStyle getStyle() const =0

Returns the style of this boss bar.

Returns

TypeDescription
BarStylethe style of the bar.

methsetStyleabstract

void setStyle(BarStyle style) =0

Sets the bar style of this boss bar.

Parameters

NameTypeDescription
styleBarStylethe style of the bar.

methhasFlagabstractconst

bool hasFlag(BarFlag flag) const =0

Returns whether this boss bar has the passed flag set.

Parameters

NameTypeDescription
flagBarFlagthe flag to check.

Returns

TypeDescription
boolwhether it has the flag.

methaddFlagabstract

void addFlag(BarFlag flag) =0

Add an optional flag to this boss bar.

Parameters

NameTypeDescription
flagBarFlagan optional flag to set on the boss bar.

methremoveFlagabstract

void removeFlag(BarFlag flag) =0

Remove an existing flag on this boss bar.

Parameters

NameTypeDescription
flagBarFlagthe existing flag to remove.

methgetProgressabstractconst

float getProgress() const =0

Returns the progress of the bar between 0.0 and 1.0.

Returns

TypeDescription
floatthe progress of the bar

methsetProgressabstract

void setProgress(float progress) =0

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

Parameters

NameTypeDescription
progressfloatthe progress of the bar

methisVisibleabstractconst

bool isVisible() const =0

Return if the boss bar is displayed to attached players.

Returns

TypeDescription
boolvisible status

methsetVisibleabstract

void setVisible(bool visible) =0

Set if the boss bar is displayed to attached players.

Parameters

NameTypeDescription
visibleboolvisible status

methaddPlayerabstract

void addPlayer(Player& player) =0

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

Parameters

NameTypeDescription
playerPlayer&the player to add

methremovePlayerabstract

void removePlayer(Player& player) =0

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

Parameters

NameTypeDescription
playerPlayer&the player to remove

methremoveAllabstract

void removeAll() =0

Removes all players from this boss bar.

methgetPlayersabstractconst

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

Returns all players viewing this boss bar.

Returns

TypeDescription
std::vector<Player*>a list of players

enumBarColor

BarColor

Values

NameValueDescription
Pink0
Blue1
Red2
Green3
Yellow4
Purple5
RebeccaPurple6
White7

enumBarFlag

BarFlag

Values

NameValueDescription
DarkenSkyDarkens the sky like during fighting a wither.
CreateFogCreates fog around the world.

enumBarStyle

BarStyle

Values

NameValueDescription
SolidMakes the boss bar solid (no segments)
Segmented6Splits the boss bar into 6 segments.
Segmented10Splits the boss bar into 10 segments.
Segmented12Splits the boss bar into 12 segments.
Segmented20Splits the boss bar into 20 segments.

On this page