PlayerSidebar extends Sidebar and is bound to exactly one player at a time. All base Sidebar methods also apply.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
PlayerSidebar extends Sidebar and binds to exactly one player. Use setPlayer(), show(), and hide() to control its display and assignment.
PlayerSidebar extends Sidebar and is bound to exactly one player at a time. All base Sidebar methods also apply.
| Method | Returns | Description |
|---|---|---|
setPlayer(Player player) | void | Assign this sidebar to a player |
removePlayer() | void | Detach the current player |
getPlayer() | Player (nullable) | The currently bound player |
| Method | Returns | Description |
|---|---|---|
show() | void | Show the sidebar to the bound player |
show(SidebarShowEvent.Reason reason) | void | Show with a specific reason (fires event with that reason) |
hide() | void | Hide the sidebar from the bound player |
PlayerSidebar sidebar = board.createPlayerSidebar("§6My HUD");
sidebar.setLine(0, "§7Hello, " + player.getName());
sidebar.setPlayer(player);
sidebar.show();
// Later, update and re-show
sidebar.setLine(0, "§7Score: §f" + score);
sidebar.show();
// Hide temporarily
sidebar.hide();