-
Notifications
You must be signed in to change notification settings - Fork 5
Scoreboard API
MattMX edited this page Jul 4, 2024
·
8 revisions
Start off by calling scoreboard(title)
val scoreboard = scoreboard(!"Title")
This will create a usable scoreboard with the title of Title
.
val scoreboard = scoreboard(!"&a&lTitle") {
add(!"&fThis is a line")
add(!" ")
add(!"&fThis is another line")
}
Remember that scoreboards can only have 16 lines
You can then display the scoreboard to a player like so.
scoreboard.showFor(player)
Currently only available on dev
branch!
val scoreboard = dynamicScoreboard(!"&dYour Title") {
var t = false
val line = scoreboardLine {
t = !t
!"${if (t) "&c" else "&7"}&m "
}
+line
+!"&fStatic line"
+{ !"&fServer Time: ${Date()}" } updateEvery 20L // every 1s
+line
}
If you wish to update manually you can also call scoreboard[index] = !"Some other component"
which will update for all players live.