Skip to main content

Documentation Index

Fetch the complete documentation index at: https://velas.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

SharedSidebar lets you show the same scoreboard to any number of players simultaneously — ideal for server-wide stats, global event timers, or any content that doesn’t differ between players.

Creating a shared sidebar

Create a SharedSidebar through your Scoreboard instance. You can provide an explicit string ID or let VelaBoard generate one automatically.
// With an explicit ID
SharedSidebar stats = board.createSharedSidebar("server-stats", "§b§lServer Stats");

// With an auto-generated ID
SharedSidebar stats = board.createSharedSidebar("§b§lServer Stats");
Use an explicit ID when you need to retrieve the sidebar later. Call board.getSharedSidebar("server-stats") at any point to get a reference back by ID. Use shared.getId() to read the ID from an existing reference.

Adding players and showing

Register players with the sidebar using addPlayer, then call show() to display it to all of them at once.
board.addPlayer(player);
stats.addPlayer(player);
stats.show();
To show the sidebar to one specific player by UUID without modifying the full roster, use showTo:
stats.showTo(player.getUniqueId());

Full example

ScoreboardHandler handler = ScoreboardAPI.getHandler();
Scoreboard board = handler.createScoreboard();

SharedSidebar stats = board.createSharedSidebar("server-stats", "§b§lServer Stats");
stats.setLine(0, "§7Online: §f" + Bukkit.getOnlinePlayers().size());
stats.setLine(1, "§7TPS: §a20.0");

for (Player player : Bukkit.getOnlinePlayers()) {
    board.addPlayer(player);
    stats.addPlayer(player);
}
stats.show();
Updating a line on a SharedSidebar updates it for all viewers. There is no per-player line override — use a PlayerSidebar if you need content to differ between players.

Hiding

Hide the sidebar from all registered players at once, or from a single player by UUID.
// Hide from everyone
stats.hide();

// Hide from one player
stats.hideFrom(player.getUniqueId());

Checking viewers

VelaBoard distinguishes between players (registered via addPlayer) and viewers (players currently seeing the sidebar). A player can be registered without currently viewing it — for example, after hideFrom is called.
MethodDescription
getPlayers()Returns all players registered with the sidebar via addPlayer.
getViewers()Returns the players currently viewing the sidebar.
isViewedBy(UUID)Returns true if the given player is currently seeing the sidebar.
isBeingViewedByAll()Returns true if every registered player is currently viewing it.
if (!stats.isViewedBy(player.getUniqueId())) {
    stats.showTo(player.getUniqueId());
}

if (stats.isBeingViewedByAll()) {
    // all registered players are currently watching
}