public class BossBar extends Object
Modifier and Type | Class and Description |
---|---|
static class |
BossBar.Builder
Represents a boss bar builder
|
static class |
BossBar.Color
Represents a color of
BossBar |
static class |
BossBar.Flag
Represents a flag of
BossBar |
static class |
BossBar.Style
Represents a style of
BossBar |
Constructor and Description |
---|
BossBar(BaseComponent[] title)
Creates a new boss bar
|
BossBar(BaseComponent[] title,
BossBar.Color color,
BossBar.Style style)
Creates a new boss bar
|
BossBar(BaseComponent[] title,
BossBar.Color color,
BossBar.Style style,
float health)
Creates a new boss bar
|
Modifier and Type | Method and Description |
---|---|
void |
addFlags(BossBar.Flag... flags)
Adds flag(s) to the boss bar
|
void |
addFlags(Iterable<BossBar.Flag> flags)
Adds flag(s) to the boss bar
|
void |
addPlayer(ProxiedPlayer player)
Adds a player to the boss bar.
|
void |
addPlayers(Iterable<ProxiedPlayer> players)
Adds all players to the boss bar
|
static BossBar.Builder |
builder()
Creates a new boss bar builder
|
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
BossBar.Color |
getColor()
Color of the boss bar
|
Collection<BossBar.Flag> |
getFlags()
Returns a unmodifiable set, containing all
of the flags, added to this boss bar
|
float |
getHealth()
Health of the boss bar.
|
Collection<ProxiedPlayer> |
getPlayers()
Returns a unmodifiable list, containing all
of the players, added to this boss bar
|
BossBar.Style |
getStyle()
Style (overlay) of the boss bar
|
BaseComponent[] |
getTitle()
Title (name) of the boss bar
|
int |
hashCode() |
boolean |
isVisible()
Visible state of the boss bar
|
void |
removeAllPlayers()
Removes all added players from the boss bar
|
void |
removeFlag(BossBar.Flag flag)
Removes a flag from the boss bar
|
void |
removeFlags(BossBar.Flag... flags)
Removes the specified flag(s) from the boss bar
|
void |
removePlayer(ProxiedPlayer player)
Removes a player from the boss bar.
|
void |
removePlayers(Iterable<ProxiedPlayer> players)
Removes all specified players from the boss bar
|
void |
setColor(BossBar.Color color)
Sets a (new) color of the boss bar
|
void |
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 state
|
String |
toString() |
public BossBar(BaseComponent[] title, BossBar.Color color, BossBar.Style style, float health)
title
- boss bar titlecolor
- boss bar colorstyle
- boss bar stylehealth
- boss bar health. Should be a number between 0.1 and 1public BossBar(BaseComponent[] title, BossBar.Color color, BossBar.Style style)
title
- boss bar titlecolor
- boss bar colorstyle
- boss bar stylepublic BossBar(BaseComponent[] title)
title
- boss bar titlepublic Collection<ProxiedPlayer> getPlayers()
public Collection<BossBar.Flag> getFlags()
public void addPlayers(Iterable<ProxiedPlayer> players)
players
- the players you wish to addaddPlayer(ProxiedPlayer)
public void addPlayer(ProxiedPlayer player)
player
- the player you wish to addpublic void removePlayers(Iterable<ProxiedPlayer> players)
players
- the players you wish to removeremovePlayer(ProxiedPlayer)
public void removeAllPlayers()
removePlayers(Iterable)
public void removePlayer(ProxiedPlayer player)
player
- the player you wish to removepublic void setTitle(BaseComponent[] title)
title
- the title you wish to setpublic void setHealth(float health)
health
- the health you wish to set.public void setColor(BossBar.Color color)
color
- the color you wish to setpublic void setStyle(BossBar.Style style)
style
- the style you wish to setpublic void setVisible(boolean visible)
visible
- valuepublic void addFlags(BossBar.Flag... flags)
flags
- the flag(s) you wish to addpublic void addFlags(Iterable<BossBar.Flag> flags)
flags
- the flag(s) you wish to addpublic void removeFlag(BossBar.Flag flag)
flag
- the flag you wish to removepublic void removeFlags(BossBar.Flag... flags)
flags
- the flag(s) you wish to removepublic static BossBar.Builder builder()
protected boolean canEqual(Object other)
public BaseComponent[] getTitle()
public BossBar.Color getColor()
public BossBar.Style getStyle()
public float getHealth()
public boolean isVisible()
Copyright © 2019–2022. All rights reserved.