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:
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