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.

VelaBoard provides two sidebar types that serve different display needs. A PlayerSidebar is bound to exactly one player and shows that player individual content. A SharedSidebar carries a single set of content that can be displayed to multiple players simultaneously. Both types share the same core Sidebar interface for managing lines, titles, and visibility.
A PlayerSidebar is scoped to a single player. Create one through your Scoreboard, assign it to the player with setPlayer(Player), and call show() to display it.
PlayerSidebar sidebar = board.createPlayerSidebar("§6Stats");
sidebar.setLine(0, "§7Score: §f250");
sidebar.setLine(1, "§7Level: §f12");
sidebar.setPlayer(player);
sidebar.show();
To hide the sidebar without destroying it, call hide(). You can call show() again later to bring it back.
sidebar.hide();
To check or change which player is assigned:
Player assigned = sidebar.getPlayer();
sidebar.setPlayer(anotherPlayer);
Use removePlayer() to detach the sidebar from its current player without destroying the sidebar itself.
Each sidebar supports up to 15 lines, indexed from 0 (top) to 14 (bottom). Use setLine(int, String) to set or update a line, removeLine(int) to clear a specific line, and clearLines() to remove all lines at once.
sidebar.setLine(0, "§7Score: §f100");
sidebar.setLine(1, "§7Level: §f5");

// Read a line back
String line = sidebar.getLine(0); // returns null if not set

// Remove a specific line
sidebar.removeLine(1);

// Remove all lines
sidebar.clearLines();
Line indices start at 0 and go up to 14, giving you 15 lines in total. Passing an index outside this range has no effect.
You can also update the title at any time:
sidebar.setTitle("§6Updated Title");
String current = sidebar.getTitle();

Visibility control

canView(boolean) controls whether the sidebar is allowed to be shown. Set it to false to prevent the sidebar from appearing even if show() is called, and back to true to re-enable display.
// Prevent the sidebar from being shown
sidebar.canView(false);

// Re-enable visibility
sidebar.canView(true);

// Check current setting
boolean allowed = sidebar.canView();
Use isBeingViewed() to check whether the sidebar is currently visible to at least one player:
if (sidebar.isBeingViewed()) {
    // sidebar is actively displayed
}

Lifecycle

When you no longer need a sidebar, call remove() to destroy it and clean up its resources. You can check whether a sidebar has already been destroyed with isRemoved().
sidebar.remove();

if (sidebar.isRemoved()) {
    // sidebar has been destroyed
}
To check which type a Sidebar reference holds, or to safely cast it:
if (sidebar.isPlayerSidebar()) {
    Optional<PlayerSidebar> ps = sidebar.asPlayerSidebar();
}

if (sidebar.isSharedSidebar()) {
    Optional<SharedSidebar> ss = sidebar.asSharedSidebar();
}
You can also check whether a particular player is associated with any sidebar type:
sidebar.hasPlayer(player); // true if the player is registered with this sidebar