ScoreboardApi

object ScoreboardApi : Listener

ScoreboardApi is the entry point for the scoreboard and boss bar system. It manages Handle instances and provides access to the ScoreboardFactory.

Functions

Link copied to clipboard

Destroys all registered handles. Recommended to be called in the plugin's onDisable method.

Link copied to clipboard

Retrieves the current factory instance.

Link copied to clipboard
inline fun <F : ScoreboardFactory> findFactory(): F?

Finds the current factory instance if it matches the specified type.

Link copied to clipboard

Retrieves the current factory instance, cast to the specified type.

Link copied to clipboard
fun init(plugin: Plugin, factory: ScoreboardFactory? = null)

Initializes the ScoreboardApi. This must be called before using other methods to enable automatic cleanup.

Link copied to clipboard
fun onQuit(event: PlayerQuitEvent)

Internal event handler to hide boards when a player quits.

Link copied to clipboard
fun register(handle: Handle)

Registers a Handle to be managed by the API.

Link copied to clipboard
fun unregister(handle: Handle)

Unregisters a Handle from the API.