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 extends Sidebar and can be shown to any number of players simultaneously. It is identified by a string ID. All base Sidebar methods also apply.

Identity

MethodReturnsDescription
getId()StringThe unique identifier for this sidebar

Player registration

MethodReturnsDescription
getPlayers()Collection<UUID>All registered player UUIDs
addPlayer(Player)voidRegister a player
removePlayer(Player)voidUnregister a player

Visibility control

MethodReturnsDescription
show()voidShow to all registered players
showTo(UUID playerUUID)voidShow to a specific player
showTo(UUID, SidebarShowEvent.Reason)voidShow to player with explicit reason
hide()voidHide from all players
hideFrom(UUID playerUUID)voidHide from a specific player
getViewers()Collection<UUID>Players currently viewing the sidebar
isViewedBy(UUID)booleanWhether a player is currently viewing
isBeingViewedByAll()booleanWhether all registered players are viewing
getPlayers() returns all registered players; getViewers() returns only those actively seeing the sidebar.

Example

SharedSidebar shared = board.createSharedSidebar("lobby", "§a§lLobby");
shared.setLine(0, "§7Players: §f" + Bukkit.getOnlinePlayers().size());

for (Player p : Bukkit.getOnlinePlayers()) {
    board.addPlayer(p);
    shared.addPlayer(p);
}
shared.show();

// Later: hide from one player
shared.hideFrom(targetPlayer.getUniqueId());

// Check viewers
if (shared.isViewedBy(player.getUniqueId())) {
    // player can see the sidebar
}