Package net.kyori.adventure.bossbar
Interface BossBar
- All Superinterfaces:
net.kyori.examination.Examinable
public interface BossBar
extends net.kyori.examination.Examinable
A bossbar.
- Since:
- 4.0.0
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
BossBar.Color
One of the colors the bar component of aBossBar
.static class
BossBar.Flag
Flags to control toggleable effects of a boss bar.static interface
BossBar.Listener
A listener for changes that happen on aBossBar
.static class
BossBar.Overlay
An overlay on the bar component of a boss bar. -
Field Summary
Fields Modifier and Type Field Description static float
MAX_PERCENT
The maximum value the percent can be.static float
MIN_PERCENT
The minimum value the percent can be. -
Method Summary
Modifier and Type Method Description @NonNull BossBar
addFlag(@NonNull BossBar.Flag flag)
Adds a flag to this bossbar.@NonNull BossBar
addFlags(@NonNull Iterable<BossBar.Flag> flags)
Adds flags to this bossbar.@NonNull BossBar
addFlags(@NonNull BossBar.Flag @NonNull ... flags)
Adds flags to this bossbar.@NonNull BossBar
addListener(@NonNull BossBar.Listener listener)
Adds a listener.static @NonNull BossBar
bossBar(@NonNull Component name, float percent, @NonNull BossBar.Color color, @NonNull BossBar.Overlay overlay)
Creates a new bossbar.static @NonNull BossBar
bossBar(@NonNull Component name, float percent, @NonNull BossBar.Color color, @NonNull BossBar.Overlay overlay, @NonNull Set<BossBar.Flag> flags)
Creates a new bossbar.@NonNull BossBar.Color
color()
Gets the color.@NonNull BossBar
color(@NonNull BossBar.Color color)
Sets the color.@NonNull Set<BossBar.Flag>
flags()
Gets the flags.@NonNull BossBar
flags(@NonNull Set<BossBar.Flag> flags)
Sets the flags.boolean
hasFlag(@NonNull BossBar.Flag flag)
Checks if this bossbar has a flag.@NonNull Component
name()
Gets the name.@NonNull BossBar
name(@NonNull Component name)
Sets the name.@NonNull BossBar.Overlay
overlay()
Gets the overlay.@NonNull BossBar
overlay(@NonNull BossBar.Overlay overlay)
Sets the overlay.float
percent()
Gets the percent.@NonNull BossBar
percent(float percent)
Sets the percent.@NonNull BossBar
removeFlag(@NonNull BossBar.Flag flag)
Removes a flag from this bossbar.@NonNull BossBar
removeFlags(@NonNull Iterable<BossBar.Flag> flags)
Removes flags from this bossbar.@NonNull BossBar
removeFlags(@NonNull BossBar.Flag @NonNull ... flags)
Removes flags from this bossbar.@NonNull BossBar
removeListener(@NonNull BossBar.Listener listener)
Removes a listener.
-
Field Details
-
MIN_PERCENT
static final float MIN_PERCENTThe minimum value the percent can be.- Since:
- 4.0.0
- See Also:
- Constant Field Values
-
MAX_PERCENT
static final float MAX_PERCENTThe maximum value the percent can be.- Since:
- 4.0.0
- See Also:
- Constant Field Values
-
-
Method Details
-
bossBar
static @NonNull BossBar bossBar(@NonNull Component name, float percent, @NonNull BossBar.Color color, @NonNull BossBar.Overlay overlay)Creates a new bossbar.- Parameters:
name
- the namepercent
- the percent, between 0 and 1color
- the coloroverlay
- the overlay- Returns:
- a bossbar
- Throws:
IllegalArgumentException
- if percent is less than 0 or greater than 1- Since:
- 4.0.0
-
bossBar
static @NonNull BossBar bossBar(@NonNull Component name, float percent, @NonNull BossBar.Color color, @NonNull BossBar.Overlay overlay, @NonNull Set<BossBar.Flag> flags)Creates a new bossbar.- Parameters:
name
- the namepercent
- the percent, between 0 and 1color
- the coloroverlay
- the overlayflags
- the flags- Returns:
- a bossbar
- Throws:
IllegalArgumentException
- if percent is less than 0 or greater than 1- Since:
- 4.0.0
-
name
@NonNull Component name()Gets the name.- Returns:
- the name
- Since:
- 4.0.0
-
name
Sets the name.- Parameters:
name
- the name- Returns:
- the bossbar
- Since:
- 4.0.0
-
percent
float percent()Gets the percent.The percent is a value between 0 and 1.
- Returns:
- the percent
- Since:
- 4.0.0
-
percent
Sets the percent.The percent is a value between 0 and 1.
- Parameters:
percent
- the percent- Returns:
- the bossbar
- Throws:
IllegalArgumentException
- if percent is less than 0 or greater than 1- Since:
- 4.0.0
-
color
@NonNull BossBar.Color color()Gets the color.- Returns:
- the color
- Since:
- 4.0.0
-
color
Sets the color.- Parameters:
color
- the color- Returns:
- the bossbar
- Since:
- 4.0.0
-
overlay
@NonNull BossBar.Overlay overlay()Gets the overlay.- Returns:
- the overlay
- Since:
- 4.0.0
-
overlay
Sets the overlay.- Parameters:
overlay
- the overlay- Returns:
- the bossbar
- Since:
- 4.0.0
-
flags
@NonNull Set<BossBar.Flag> flags()Gets the flags.- Returns:
- the flags
- Since:
- 4.0.0
-
flags
Sets the flags.- Parameters:
flags
- the flags- Returns:
- the bossbar
- Since:
- 4.0.0
-
hasFlag
Checks if this bossbar has a flag.- Parameters:
flag
- the flag- Returns:
true
if this bossbar has the flag,false
otherwise- Since:
- 4.0.0
-
addFlag
Adds a flag to this bossbar.- Parameters:
flag
- the flag- Returns:
- the bossbar
- Since:
- 4.0.0
-
removeFlag
Removes a flag from this bossbar.- Parameters:
flag
- the flag- Returns:
- the bossbar
- Since:
- 4.0.0
-
addFlags
Adds flags to this bossbar.- Parameters:
flags
- the flags- Returns:
- the bossbar
- Since:
- 4.0.0
-
removeFlags
Removes flags from this bossbar.- Parameters:
flags
- the flags- Returns:
- the bossbar
- Since:
- 4.0.0
-
addFlags
Adds flags to this bossbar.- Parameters:
flags
- the flags- Returns:
- the bossbar
- Since:
- 4.0.0
-
removeFlags
Removes flags from this bossbar.- Parameters:
flags
- the flags- Returns:
- the bossbar
- Since:
- 4.0.0
-
addListener
Adds a listener.- Parameters:
listener
- a listener- Returns:
- the bossbar
- Since:
- 4.0.0
-
removeListener
Removes a listener.- Parameters:
listener
- a listener- Returns:
- the bossbar
- Since:
- 4.0.0
-