DefaultBossBarHandle

class DefaultBossBarHandle(title: (Player) -> Component, progress: (Player) -> Float, bar: BossBar, plugin: Plugin?, refreshInterval: Ticks?, visibilityCondition: (Player) -> Boolean?) : BossBarHandle

A default implementation of BossBarHandle using the Adventure API. This handle manages the visibility and content of a BossBar for multiple players.

Parameters

title

A function that provides the title component for a player.

progress

A function that provides the progress value (0.0 to 1.0) for a player.

bar

The BossBar instance to manage.

plugin

The plugin instance for scheduling updates (optional).

refreshInterval

The interval at which the bar should refresh (optional).

visibilityCondition

A predicate that determines if the bar should be visible to a player (optional).

Constructors

Link copied to clipboard
constructor(title: (Player) -> Component, progress: (Player) -> Float, bar: BossBar, plugin: Plugin?, refreshInterval: Ticks?, visibilityCondition: (Player) -> Boolean?)

Functions

Link copied to clipboard
open override fun destroy()

Hides the display element from all players and releases associated resources.

Link copied to clipboard
open override fun hide(player: Player)

Hides the display element from the specified player.

Link copied to clipboard
open override fun show(player: Player)

Shows the display element to the specified player.

Link copied to clipboard
open override fun update()

Updates the state of the scoreboard or boss bar.