Package-level declarations

A sideboard builder (displayed using scoreboards), supporting boards with changing content. The sideboard can be displayed to a selection of players.

Sideboard management

Creating a sideboard

Use the top-level sideboard function.

val mySideboard = sideboard("My Sideboard".literal) {
// build your sideboard here
}

Display sideboard to a player

To show the sideboard to a player, you can simply use the displayToPlayer function.

mySideboard.displayToPlayer(player)

To remove a sideboard for a player, just call hideFromPlayer.

Sideboard builder

Basic text line

val mySideboard = sideboard("My Sideboard".literal) {
line("Hey, this is".literal)
line("my cool board!".literal)
emptyLine()
line(literalText("colors work as well!") {
color = 0xFF9658
})
}

See line and emptyLine.

Updatable line

You can create an updatable line as a normal value everywhere

val updatableLine = SideboardLine.Updatable()
// or optionally pass an initial value
val updatableLine = SideboardLine.Updatable(initial = "Nothing here".literal)

and then use it in a sideboard builder

val mySideboard = sideboard("My Sideboard".literal) {
line("The following line".literal)
line("is updatable:".literal)
line(updatableLine)
}

To change the value of that updatable line, just call either launchUpdate or if you are already in a suspending context just call update.

updatableLine.update("New line content!".literal)

Periodically updating line

If you want to update a line periodically, you can easily do so using the updatingLine function of the sideboard builder.

val mySideboard = sideboard("My Sideboard".literal) {
updatingLine(1.seconds) {
literalText("changing color") {
color = (0x000000..0xFFFFFF).random()
}
}
}

Types

Link copied to clipboard
class ChangingSideboardLine(val textFlow: Flow<Component>) : SideboardLine

A sideboard line which does change. Everytime the given textFlow emits a new Text, the sideboard line will be updated for all players currently seeing the Sideboard.

Link copied to clipboard
class Sideboard(name: String, displayName: Component, numberFormat: NumberFormat, lines: List<SideboardLine>)

A sideboard which can be displayed to a variable collection of players using the displayToPlayer function. A sideboard is an abstraction of Minecraft's server side scoreboards displayed on the right-hand side of the screen.

Link copied to clipboard

A helper class which is used to create a Sideboard.

Link copied to clipboard
interface SideboardLine

This interface represents one line in a Sideboard.

Link copied to clipboard
class SimpleSideboardLine(text: Component) : SideboardLine

A sideboard line which does not change and always displays the same Text.

Functions

Link copied to clipboard
fun ServerPlayer.showSideboard(sideboard: Sideboard)

Displays the given sideboard to the player. Future updates will be visible to the player as well.

Link copied to clipboard
inline fun sideboard(displayName: Component, name: String = displayName.string.filter { it.isLetter() }.take(16), numberFormat: NumberFormat = BlankFormat.INSTANCE, builder: SideboardBuilder.() -> Unit): Sideboard

Opens a new sideboard builder and returns the final sideboard.