Skip to content

Sidebar Basics

Builder-style Full Update

kotlin
import net.kyori.adventure.text.Component
import net.kyori.adventure.text.format.NamedTextColor
import net.minestom.server.scoreboard.Sidebar.NumberFormat

sidebar.update {
        title(Component.text("Sidebar", NamedTextColor.YELLOW))
        line(Component.empty())
        line("123", NumberFormat.blank())
        line(Component.empty())
}
java
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.minestom.server.scoreboard.Sidebar.NumberFormat;

sidebar.update(builder -> builder
        .title(Component.text("Sidebar", NamedTextColor.YELLOW))
        .line(Component.empty())
        .line("123", NumberFormat.blank())
        .line(Component.empty()));

Update Title and Lines

kotlin
manager.updateTitle(player, "Matchmaking")
manager.updateLine(player, 1, "Rank: Premium")
java
manager.updateTitle(player, "Matchmaking");
manager.updateLine(player, 1, "Rank: Premium");

Update Placeholder Values

setReplacers replaces the full map. addReplacers merges into the current map.

kotlin
manager.setReplacers(player, mapOf("{online}" to "140"))
manager.addReplacers(player, mapOf("{rank}" to "VIP"))
java
manager.setReplacers(player, Map.of("{online}", "140"));
manager.addReplacers(player, Map.of("{rank}", "VIP"));

Line Limits and Indexes

  • Maximum line count: 15
  • Line index starts at 0

If a line index is out of bounds, the update is safely ignored.

Released under the MIT License.