PlayerSidebar is bound to one player at a time and is the simplest way to show player-specific HUD data — things like score, level, or location that differ between players.
Complete setup flow
1
Get the scoreboard handler
Obtain the
ScoreboardHandler from the API entry point.2
Create a scoreboard
Create a
Scoreboard instance through the handler.3
Register the player
Add the player to the scoreboard before creating any sidebars for them.
4
Create the sidebar with a title
Create a
PlayerSidebar with a display title.5
Set lines
Populate the sidebar lines. Line
0 is the top line.6
Assign the player
Bind the sidebar to the player using
setPlayer.7
Show the sidebar
Call
show() to display the sidebar to the player.Full example
Updating lines dynamically
CallsetLine with a new value to update a line’s content. If you need the change to be visible immediately, call show() again after updating.
Hiding and removing
Usehide() to temporarily hide the sidebar without destroying it. You can call show() again later to bring it back.
remove() to destroy it and free its resources.
Checking state
VelaBoard provides several methods to inspect the current state of aPlayerSidebar:
A player can only have one sidebar visible at a time. Calling
show() on a new sidebar automatically replaces the one they are currently viewing.