> ## Documentation Index
> Fetch the complete documentation index at: https://velas.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# PlayerSidebar API: Bind and Show a Per-Player Sidebar

> 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](/api/sidebar) also apply.

## Player binding

| 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      |

## Visibility

| 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                     |

## Example

```java theme={null}
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();
```
