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
})
}
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
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.
A helper class which is used to create a Sideboard.
This interface represents one line in a Sideboard.
A sideboard line which does not change and always displays the same Text.
Functions
Displays the given sideboard to the player. Future updates will be visible to the player as well.