Player capabilities
Minestom features a number of interaction methods for players. Many of them are described below, however this list is not exhaustive.
It is worth reviewing the Adventure API before this, because these systems depend heavily on Component
.
Sidebars (Scoreboards)
Sidebar
s can be used to display up to 16 lines on a scoreboard for the player. They are created given a title as follows:
Sidebar titles do not support JSON chat components, however the provided component will be serialized using Adventure's legacy serializer.
Once created, a scoreboard can be added and removed from players as follows:
Sidebar Line
Lines on a sidebar are made up of ScoreboardLine
s. They render on the scoreboard in order of their line number (score), where the vertically highest line represents the highest line number (score). If two lines have the same line number (score), they will be sorted alphabetically.
ScoreboardLine
s can be created using their constructor:
Once created, scoreboard lines may be added to Sidebar
s as follows:
Lines are indexed by their unique id, and can be modified with it:
Notifications
Notification
s are a system to send advancement completion toasts to a player as a form of communication.
They are a wrapper around Advancement
, so you do not need to create any advancements to use them, just a Notification
. See the Advancements page for more information on advancements.
To send the notification, use one of the static methods on NotificationCenter
:
The example renders as the following:
Last updated