Interface Facet.BossBar<V>
- Type Parameters:
V- a viewer type
- All Superinterfaces:
AutoCloseable,BossBar.Listener,Closeable
- All Known Subinterfaces:
Facet.BossBarEntity<V,,P> Facet.BossBarPacket<V>
A facet that listens to boss bar changes.
- Since:
- 4.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceFacet.BossBar.Builder<V,B extends Facet.BossBar<V>> A builder for boss bar facets. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a viewer to the boss bar.default voidbossBarInitialized(@NotNull BossBar bar) Initializes the boss bar.voidclose()Removes all viewers.booleanisEmpty()Gets whether the boss bar has no viewers.voidremoveViewer(V viewer) Removes a viewer from the boss bar.Methods inherited from interface net.kyori.adventure.bossbar.BossBar.Listener
bossBarColorChanged, bossBarFlagsChanged, bossBarNameChanged, bossBarOverlayChanged, bossBarPercentChanged, bossBarProgressChanged
-
Field Details
-
VERSION_BOSS_BAR
- See Also:
-
PROTOCOL_BOSS_BAR
static final int PROTOCOL_BOSS_BAR- See Also:
-
-
Method Details
-
bossBarInitialized
Initializes the boss bar.- Parameters:
bar- a boss bar- Since:
- 4.0.0
-
addViewer
Adds a viewer to the boss bar.- Parameters:
viewer- a viewer- Since:
- 4.0.0
-
removeViewer
Removes a viewer from the boss bar.- Parameters:
viewer- a viewer- Since:
- 4.0.0
-
isEmpty
boolean isEmpty()Gets whether the boss bar has no viewers.- Returns:
- if the boss bar is empty
- Since:
- 4.0.0
-
close
void close()Removes all viewers.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Since:
- 4.0.0
-