Class BossBar
java.lang.Object
com.mrivanplays.ivancord.api.util.BossBar
Represents a boss bar
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionBossBar(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 TypeMethodDescriptionvoidaddFlags(BossBar.Flag... flags) Adds flag(s) to the boss barvoidaddFlags(Iterable<BossBar.Flag> flags) Adds flag(s) to the boss barvoidaddPlayer(ProxiedPlayer player) Adds a player to the boss bar.voidaddPlayers(Iterable<ProxiedPlayer> players) Adds all players to the boss barstatic BossBar.Builderbuilder()Creates a new boss bar builderprotected booleanbooleangetColor()Color of the boss bargetFlags()Returns a unmodifiable set, containing all of the flags, added to this boss barfloatHealth 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 barinthashCode()booleanVisible state of the boss barvoidRemoves all added players from the boss barvoidremoveFlag(BossBar.Flag flag) Removes a flag from the boss barvoidremoveFlags(BossBar.Flag... flags) Removes the specified flag(s) from the boss barvoidremovePlayer(ProxiedPlayer player) Removes a player from the boss bar.voidremovePlayers(Iterable<ProxiedPlayer> players) Removes all specified players from the boss barvoidsetColor(BossBar.Color color) Sets a (new) color of the boss barvoidsetHealth(float health) Sets the health of the boss bar.voidsetStyle(BossBar.Style style) Sets a (new) boss bar style (overlay)voidsetTitle(BaseComponent[] title) Sets a (new) boss bar title (name)voidsetVisible(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
-