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.

Sidebar is the base interface implemented by both PlayerSidebar and SharedSidebar. It provides the methods common to all sidebar types — managing the title and lines, controlling visibility, checking the sidebar type, and destroying it when you are done. When you have a Sidebar reference of unknown type, use the type-checking and cast helpers to work with it safely.

Title and lines

MethodReturnsDescription
getTitle()StringCurrent sidebar title
setTitle(String title)voidUpdate the sidebar title
setLine(int line, String text)voidSet the text at a line index (0–14)
getLine(int line)String (nullable)Get text at a line index, or null
removeLine(int line)voidRemove a specific line
clearLines()voidRemove all lines
Line indices range from 0 to 14, giving a maximum of 15 lines.

Visibility

MethodReturnsDescription
canView()booleanWhether the sidebar is allowed to be shown
canView(boolean)voidEnable or disable the sidebar from being shown
isBeingViewed()booleanWhether the sidebar is currently visible to any player
hasPlayer(Player)booleanWhether the given player is associated with this sidebar

Type checking

MethodReturnsDescription
isPlayerSidebar()booleanTrue if this is a PlayerSidebar
isSharedSidebar()booleanTrue if this is a SharedSidebar
asPlayerSidebar()Optional<PlayerSidebar>Cast helper
asSharedSidebar()Optional<SharedSidebar>Cast helper

Lifecycle

MethodReturnsDescription
remove()voidPermanently destroy this sidebar
isRemoved()booleanWhether remove() has been called

Example

Sidebar sidebar = board.getSidebar(player);
if (sidebar != null && !sidebar.isRemoved()) {
    sidebar.setTitle("§e§lUpdated Title");
    sidebar.setLine(0, "§7New content");
    // Check type
    sidebar.asPlayerSidebar().ifPresent(ps -> ps.show());
}