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 SummaryNested Classes Modifier and Type Interface Description static classBossBar.ColorOne of the colors the bar component of aBossBar.static classBossBar.FlagFlags to control toggleable effects of a boss bar.static interfaceBossBar.ListenerA listener for changes that happen on aBossBar.static classBossBar.OverlayAn overlay on the bar component of a boss bar.
- 
Field SummaryFields Modifier and Type Field Description static floatMAX_PERCENTDeprecated.for removal since 4.2.0, useMAX_PROGRESSstatic floatMAX_PROGRESSThe maximum value the progress can be.static floatMIN_PERCENTDeprecated.for removal since 4.2.0, useMIN_PROGRESSstatic floatMIN_PROGRESSThe minimum value the progress can be.
- 
Method SummaryModifier and Type Method Description @NonNull BossBaraddFlag(@NonNull BossBar.Flag flag)Adds a flag to this bossbar.@NonNull BossBaraddFlags(@NonNull Iterable<BossBar.Flag> flags)Adds flags to this bossbar.@NonNull BossBaraddFlags(@NonNull BossBar.Flag @NonNull ... flags)Adds flags to this bossbar.@NonNull BossBaraddListener(@NonNull BossBar.Listener listener)Adds a listener.static @NonNull BossBarbossBar(@NonNull Component name, float progress, @NonNull BossBar.Color color, @NonNull BossBar.Overlay overlay)Creates a new bossbar.static @NonNull BossBarbossBar(@NonNull Component name, float progress, @NonNull BossBar.Color color, @NonNull BossBar.Overlay overlay, @NonNull Set<BossBar.Flag> flags)Creates a new bossbar.@NonNull BossBar.Colorcolor()Gets the color.@NonNull BossBarcolor(@NonNull BossBar.Color color)Sets the color.@NonNull Set<BossBar.Flag>flags()Gets the flags.@NonNull BossBarflags(@NonNull Set<BossBar.Flag> flags)Sets the flags.booleanhasFlag(@NonNull BossBar.Flag flag)Checks if this bossbar has a flag.@NonNull Componentname()Gets the name.@NonNull BossBarname(@NonNull Component name)Sets the name.@NonNull BossBar.Overlayoverlay()Gets the overlay.@NonNull BossBaroverlay(@NonNull BossBar.Overlay overlay)Sets the overlay.default floatpercent()Deprecated.for removal since 4.2.0, useprogress()default @NonNull BossBarpercent(float progress)Deprecated.for removal since 4.2.0, useprogress(float)floatprogress()Gets the progress.@NonNull BossBarprogress(float progress)Sets the progress.@NonNull BossBarremoveFlag(@NonNull BossBar.Flag flag)Removes a flag from this bossbar.@NonNull BossBarremoveFlags(@NonNull Iterable<BossBar.Flag> flags)Removes flags from this bossbar.@NonNull BossBarremoveFlags(@NonNull BossBar.Flag @NonNull ... flags)Removes flags from this bossbar.@NonNull BossBarremoveListener(@NonNull BossBar.Listener listener)Removes a listener.
- 
Field Details- 
MIN_PROGRESSstatic final float MIN_PROGRESSThe minimum value the progress can be.- Since:
- 4.2.0
- See Also:
- Constant Field Values
 
- 
MAX_PROGRESSstatic final float MAX_PROGRESSThe maximum value the progress can be.- Since:
- 4.2.0
- See Also:
- Constant Field Values
 
- 
MIN_PERCENTDeprecated.for removal since 4.2.0, useMIN_PROGRESSThe minimum value the progress can be.- Since:
- 4.0.0
- See Also:
- Constant Field Values
 
- 
MAX_PERCENTDeprecated.for removal since 4.2.0, useMAX_PROGRESSThe maximum value the progress can be.- Since:
- 4.0.0
- See Also:
- Constant Field Values
 
 
- 
- 
Method Details- 
bossBarstatic @NonNull BossBar bossBar(@NonNull Component name, float progress, @NonNull BossBar.Color color, @NonNull BossBar.Overlay overlay)Creates a new bossbar.- Parameters:
- name- the name
- progress- the progress, between 0 and 1
- color- the color
- overlay- the overlay
- Returns:
- a bossbar
- Throws:
- IllegalArgumentException- if progress is less than 0 or greater than 1
- Since:
- 4.0.0
 
- 
bossBarstatic @NonNull BossBar bossBar(@NonNull Component name, float progress, @NonNull BossBar.Color color, @NonNull BossBar.Overlay overlay, @NonNull Set<BossBar.Flag> flags)Creates a new bossbar.- Parameters:
- name- the name
- progress- the progress, between 0 and 1
- color- the color
- overlay- the overlay
- flags- the flags
- Returns:
- a bossbar
- Throws:
- IllegalArgumentException- if progress 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
 
- 
nameSets the name.- Parameters:
- name- the name
- Returns:
- the bossbar
- Since:
- 4.0.0
 
- 
progressfloat progress()Gets the progress.The progress is a value between 0 and 1. - Returns:
- the progress
- Since:
- 4.0.0
 
- 
progressSets the progress.The progress is a value between 0 and 1. - Parameters:
- progress- the progress
- Returns:
- the bossbar
- Throws:
- IllegalArgumentException- if progress is less than 0 or greater than 1
- Since:
- 4.0.0
 
- 
percentDeprecated.for removal since 4.2.0, useprogress()Gets the progress.The progress is a value between 0 and 1. - Returns:
- the progress
- Since:
- 4.0.0
 
- 
percentDeprecated.for removal since 4.2.0, useprogress(float)Sets the progress.The progress is a value between 0 and 1. - Parameters:
- progress- the progress
- Returns:
- the bossbar
- Throws:
- IllegalArgumentException- if progress 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
 
- 
colorSets 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
 
- 
overlaySets 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
 
- 
flagsSets the flags.- Parameters:
- flags- the flags
- Returns:
- the bossbar
- Since:
- 4.0.0
 
- 
hasFlagChecks if this bossbar has a flag.- Parameters:
- flag- the flag
- Returns:
- trueif this bossbar has the flag,- falseotherwise
- Since:
- 4.0.0
 
- 
addFlagAdds a flag to this bossbar.- Parameters:
- flag- the flag
- Returns:
- the bossbar
- Since:
- 4.0.0
 
- 
removeFlagRemoves a flag from this bossbar.- Parameters:
- flag- the flag
- Returns:
- the bossbar
- Since:
- 4.0.0
 
- 
addFlagsAdds flags to this bossbar.- Parameters:
- flags- the flags
- Returns:
- the bossbar
- Since:
- 4.0.0
 
- 
removeFlagsRemoves flags from this bossbar.- Parameters:
- flags- the flags
- Returns:
- the bossbar
- Since:
- 4.0.0
 
- 
addFlagsAdds flags to this bossbar.- Parameters:
- flags- the flags
- Returns:
- the bossbar
- Since:
- 4.0.0
 
- 
removeFlagsRemoves flags from this bossbar.- Parameters:
- flags- the flags
- Returns:
- the bossbar
- Since:
- 4.0.0
 
- 
addListenerAdds a listener.- Parameters:
- listener- a listener
- Returns:
- the bossbar
- Since:
- 4.0.0
 
- 
removeListenerRemoves a listener.- Parameters:
- listener- a listener
- Returns:
- the bossbar
- Since:
- 4.0.0
 
 
-