sidebar

inline fun sidebar(title: Component, block: SidebarBuilder.() -> Unit): SidebarHandle

Creates and returns a SidebarHandle using a DSL.

Example usage:

val handle = sidebar(Component.text("My Sidebar")) {
line(0, Component.text("Welcome!"))
line(1) { player -> Component.text("Player: ${player.name}") }
}
handle.show(player)

Return

A new SidebarHandle.

Parameters

title

The title of the sidebar.

block

The builder block to configure the sidebar.


inline fun sidebar(noinline title: () -> Component, block: SidebarBuilder.() -> Unit): SidebarHandle

Creates and returns a SidebarHandle using a DSL with a dynamic title.

Return

A new SidebarHandle.

Parameters

title

A function providing the title of the sidebar.

block

The builder block to configure the sidebar.


inline fun Plugin.sidebar(title: Component, block: SidebarBuilder.() -> Unit): SidebarHandle

Creates and returns a SidebarHandle with auto-refresh enabled for the plugin.

Receiver

The plugin instance.

Return

A new SidebarHandle.

Parameters

title

The title of the sidebar.

block

The builder block to configure the sidebar.


inline fun Plugin.sidebar(noinline title: () -> Component, block: SidebarBuilder.() -> Unit): SidebarHandle

Creates and returns a SidebarHandle with auto-refresh enabled for the plugin.

Receiver

The plugin instance.

Return

A new SidebarHandle.

Parameters

title

A function providing the title of the sidebar.

block

The builder block to configure the sidebar.


inline fun Plugin.sidebar(refreshInterval: Ticks, title: Component, block: SidebarBuilder.() -> Unit): SidebarHandle

Creates and returns a SidebarHandle with a specific refresh interval.

Receiver

The plugin instance.

Return

A new SidebarHandle.

Parameters

refreshInterval

The interval at which the sidebar should refresh.

title

The title of the sidebar.

block

The builder block to configure the sidebar.


inline fun Plugin.sidebar(refreshInterval: Ticks, noinline title: () -> Component, block: SidebarBuilder.() -> Unit): SidebarHandle

Creates and returns a SidebarHandle with a specific refresh interval and dynamic title.

Receiver

The plugin instance.

Return

A new SidebarHandle.

Parameters

refreshInterval

The interval at which the sidebar should refresh.

title

A function providing the title of the sidebar.

block

The builder block to configure the sidebar.