Class BossBar
java.lang.Object
com.mrivanplays.ivancord.api.util.BossBar
Represents a boss bar
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionBossBar
(BaseComponent[] title) Creates a new boss barBossBar
(BaseComponent[] title, BossBar.Color color, BossBar.Style style) Creates a new boss barBossBar
(BaseComponent[] title, BossBar.Color color, BossBar.Style style, float health) Creates a new boss bar -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFlags
(BossBar.Flag... flags) Adds flag(s) to the boss barvoid
addFlags
(Iterable<BossBar.Flag> flags) Adds flag(s) to the boss barvoid
addPlayer
(ProxiedPlayer player) Adds a player to the boss bar.void
addPlayers
(Iterable<ProxiedPlayer> players) Adds all players to the boss barstatic BossBar.Builder
builder()
Creates a new boss bar builderprotected boolean
boolean
getColor()
Color of the boss bargetFlags()
Returns a unmodifiable set, containing all of the flags, added to this boss barfloat
Health of the boss bar.Returns a unmodifiable list, containing all of the players, added to this boss bargetStyle()
Style (overlay) of the boss bargetTitle()
Title (name) of the boss barint
hashCode()
boolean
Visible state of the boss barvoid
Removes all added players from the boss barvoid
removeFlag
(BossBar.Flag flag) Removes a flag from the boss barvoid
removeFlags
(BossBar.Flag... flags) Removes the specified flag(s) from the boss barvoid
removePlayer
(ProxiedPlayer player) Removes a player from the boss bar.void
removePlayers
(Iterable<ProxiedPlayer> players) Removes all specified players from the boss barvoid
setColor
(BossBar.Color color) Sets a (new) color of the boss barvoid
setHealth
(float health) Sets the health of the boss bar.void
setStyle
(BossBar.Style style) Sets a (new) boss bar style (overlay)void
setTitle
(BaseComponent[] title) Sets a (new) boss bar title (name)void
setVisible
(boolean visible) Sets this boss bar's visible statetoString()
-
Constructor Details
-
BossBar
Creates a new boss bar- Parameters:
title
- boss bar titlecolor
- boss bar colorstyle
- boss bar stylehealth
- boss bar health. Should be a number between 0.1 and 1
-
BossBar
Creates a new boss bar- Parameters:
title
- boss bar titlecolor
- boss bar colorstyle
- boss bar style
-
BossBar
Creates a new boss bar- Parameters:
title
- boss bar title
-
-
Method Details
-
getPlayers
Returns a unmodifiable list, containing all of the players, added to this boss bar- Returns:
- players, if no one added empty list
-
getFlags
Returns a unmodifiable set, containing all of the flags, added to this boss bar- Returns:
- flags, if no one added empty set
-
addPlayers
Adds all players to the boss bar- Parameters:
players
- the players you wish to add- See Also:
-
addPlayer
Adds a player to the boss bar. This makes the player see the boss bar if it is visible.- Parameters:
player
- the player you wish to add
-
removePlayers
Removes all specified players from the boss bar- Parameters:
players
- the players you wish to remove- See Also:
-
removeAllPlayers
public void removeAllPlayers()Removes all added players from the boss bar- See Also:
-
removePlayer
Removes a player from the boss bar. This makes the player not see the boss bar no matter if it is visible or not.- Parameters:
player
- the player you wish to remove
-
setTitle
Sets a (new) boss bar title (name)- Parameters:
title
- the title you wish to set
-
setHealth
public void setHealth(float health) Sets the health of the boss bar. The health is being represented as a number between 0 and 1. The minimum is 0.1 and the maximum is 1- Parameters:
health
- the health you wish to set.
-
setColor
Sets a (new) color of the boss bar- Parameters:
color
- the color you wish to set
-
setStyle
Sets a (new) boss bar style (overlay)- Parameters:
style
- the style you wish to set
-
setVisible
public void setVisible(boolean visible) Sets this boss bar's visible state- Parameters:
visible
- value
-
addFlags
Adds flag(s) to the boss bar- Parameters:
flags
- the flag(s) you wish to add
-
addFlags
Adds flag(s) to the boss bar- Parameters:
flags
- the flag(s) you wish to add
-
removeFlag
Removes a flag from the boss bar- Parameters:
flag
- the flag you wish to remove
-
removeFlags
Removes the specified flag(s) from the boss bar- Parameters:
flags
- the flag(s) you wish to remove
-
builder
Creates a new boss bar builder- Returns:
- builder
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-
getTitle
Title (name) of the boss bar -
getColor
Color of the boss bar -
getStyle
Style (overlay) of the boss bar -
getHealth
public float getHealth()Health of the boss bar. Represents a number between 0.1 and 1 -
isVisible
public boolean isVisible()Visible state of the boss bar
-