endstone/boss
Classes
| Name | Description |
|---|---|
BossBar | Represents a boss bar that is displayed to players. |
classBossBar
Defined in <endstone/boss/boss_bar.h>
Represents a boss bar that is displayed to players.
Methods
| Name | Description |
|---|---|
~BossBar | |
getTitle | Returns the title of this boss bar. |
setTitle | Sets the title of this boss bar. |
getColor | Returns the color of this boss bar. |
setColor | Sets the color of this boss bar. |
getStyle | Returns the style of this boss bar. |
setStyle | Sets the bar style of this boss bar. |
hasFlag | Returns whether this boss bar has the passed flag set. |
addFlag | Add an optional flag to this boss bar. |
removeFlag | Remove an existing flag on this boss bar. |
getProgress | Returns the progress of the bar between 0.0 and 1.0. |
setProgress | Sets the progress of the bar. Values should be between 0.0 (empty) and 1.0 (full) |
isVisible | Return if the boss bar is displayed to attached players. |
setVisible | Set if the boss bar is displayed to attached players. |
addPlayer | Adds the player to this boss bar causing it to display on their screen. |
removePlayer | Removes the player from this boss bar causing it to be removed from their screen. |
removeAll | Removes all players from this boss bar. |
getPlayers | Returns all players viewing this boss bar. |
meth~BossBarvirtual
~BossBar() =defaultmethgetTitleabstractconst
std::string getTitle() const =0Returns the title of this boss bar.
Returns
| Type | Description |
|---|---|
std::string | the title of the bar |
methsetTitleabstract
void setTitle(std::string title) =0Sets the title of this boss bar.
Parameters
| Name | Type | Description |
|---|---|---|
title | std::string | the title of the bar |
methgetColorabstractconst
BarColor getColor() const =0Returns the color of this boss bar.
Returns
| Type | Description |
|---|---|
BarColor | the color of the bar |
methsetColorabstract
void setColor(BarColor color) =0Sets the color of this boss bar.
Parameters
| Name | Type | Description |
|---|---|---|
color | BarColor | the color of the bar |
methgetStyleabstractconst
BarStyle getStyle() const =0Returns the style of this boss bar.
Returns
| Type | Description |
|---|---|
BarStyle | the style of the bar. |
methsetStyleabstract
void setStyle(BarStyle style) =0Sets the bar style of this boss bar.
Parameters
| Name | Type | Description |
|---|---|---|
style | BarStyle | the style of the bar. |
methhasFlagabstractconst
bool hasFlag(BarFlag flag) const =0Returns whether this boss bar has the passed flag set.
Parameters
| Name | Type | Description |
|---|---|---|
flag | BarFlag | the flag to check. |
Returns
| Type | Description |
|---|---|
bool | whether it has the flag. |
methaddFlagabstract
void addFlag(BarFlag flag) =0Add an optional flag to this boss bar.
Parameters
| Name | Type | Description |
|---|---|---|
flag | BarFlag | an optional flag to set on the boss bar. |
methremoveFlagabstract
void removeFlag(BarFlag flag) =0Remove an existing flag on this boss bar.
Parameters
| Name | Type | Description |
|---|---|---|
flag | BarFlag | the existing flag to remove. |
methgetProgressabstractconst
float getProgress() const =0Returns the progress of the bar between 0.0 and 1.0.
Returns
| Type | Description |
|---|---|
float | the progress of the bar |
methsetProgressabstract
void setProgress(float progress) =0Sets the progress of the bar. Values should be between 0.0 (empty) and 1.0 (full)
Parameters
| Name | Type | Description |
|---|---|---|
progress | float | the progress of the bar |
methisVisibleabstractconst
bool isVisible() const =0Return if the boss bar is displayed to attached players.
Returns
| Type | Description |
|---|---|
bool | visible status |
methsetVisibleabstract
void setVisible(bool visible) =0Set if the boss bar is displayed to attached players.
Parameters
| Name | Type | Description |
|---|---|---|
visible | bool | visible status |
methaddPlayerabstract
void addPlayer(Player& player) =0Adds the player to this boss bar causing it to display on their screen.
Parameters
| Name | Type | Description |
|---|---|---|
player | Player& | the player to add |
methremovePlayerabstract
void removePlayer(Player& player) =0Removes the player from this boss bar causing it to be removed from their screen.
Parameters
| Name | Type | Description |
|---|---|---|
player | Player& | the player to remove |
methremoveAllabstract
void removeAll() =0Removes all players from this boss bar.
methgetPlayersabstractconst
std::vector<Player*> getPlayers() const =0Returns all players viewing this boss bar.
Returns
| Type | Description |
|---|---|
std::vector<Player*> | a list of players |
enumBarColor
BarColorValues
| Name | Value | Description |
|---|---|---|
Pink | 0 | |
Blue | 1 | |
Red | 2 | |
Green | 3 | |
Yellow | 4 | |
Purple | 5 | |
RebeccaPurple | 6 | |
White | 7 |
enumBarFlag
BarFlagValues
| Name | Value | Description |
|---|---|---|
DarkenSky | Darkens the sky like during fighting a wither. | |
CreateFog | Creates fog around the world. |
enumBarStyle
BarStyleValues
| Name | Value | Description |
|---|---|---|
Solid | Makes the boss bar solid (no segments) | |
Segmented6 | Splits the boss bar into 6 segments. | |
Segmented10 | Splits the boss bar into 10 segments. | |
Segmented12 | Splits the boss bar into 12 segments. | |
Segmented20 | Splits the boss bar into 20 segments. |