endstone::BossBar
Represents a boss bar that is displayed to players.
Functions:
| Name | Description |
|---|---|
addFlag | Add an optional flag to this boss bar. |
addPlayer | Adds the player to this boss bar causing it to display on their screen. |
getColor | Returns the color of this boss bar. |
getPlayers | Returns all players viewing this boss bar. |
getProgress | Returns the progress of the bar between 0.0 and 1.0. |
getStyle | Returns the style of this boss bar. |
getTitle | Returns the title of this boss bar. |
hasFlag | Returns whether this boss bar has the passed flag set. |
isVisible | Return if the boss bar is displayed to attached players. |
removeAll | Removes all players from this boss bar. |
removeFlag | Remove an existing flag on this boss bar. |
removePlayer | Removes the player from this boss bar causing it to be removed from their screen. |
setColor | Sets the color of this boss bar. |
setProgress | Sets the progress of the bar. Values should be between 0.0 (empty) and 1.0 (full) |
setStyle | Sets the bar style of this boss bar. |
setTitle | Sets the title of this boss bar. |
setVisible | Set if the boss bar is displayed to attached players. |
addFlag
void addFlag(BarFlag flag)Add an optional flag to this boss bar.
Parameters:
flagan 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:
playerthe player to add
getColor
BarColor getColor() constReturns the color of this boss bar.
Returns:
the color of the bar
getPlayers
std::vector<Player *> getPlayers() constReturns all players viewing this boss bar.
Returns:
a list of players
getProgress
float getProgress() constReturns the progress of the bar between 0.0 and 1.0.
Returns:
the progress of the bar
getStyle
BarStyle getStyle() constReturns the style of this boss bar.
Returns:
the style of the bar.
getTitle
std::string getTitle() constReturns the title of this boss bar.
Returns:
the title of the bar
hasFlag
bool hasFlag(BarFlag flag) constReturns whether this boss bar has the passed flag set.
Parameters:
flagthe flag to check.
Returns:
whether it has the flag.
isVisible
bool isVisible() constReturn 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:
flagthe 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:
playerthe player to remove
setColor
void setColor(BarColor color)Sets the color of this boss bar.
Parameters:
colorthe 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:
progressthe progress of the bar
setStyle
void setStyle(BarStyle style)Sets the bar style of this boss bar.
Parameters:
stylethe style of the bar.
setTitle
void setTitle(std::string title)Sets the title of this boss bar.
Parameters:
titlethe title of the bar
setVisible
void setVisible(bool visible)Set if the boss bar is displayed to attached players.
Parameters:
visiblevisible status