> For the complete documentation index, see [llms.txt](https://wiki.microtus.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.microtus.dev/feature/player-capabilities.md).

# 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](/feature/adventure.md) 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:

```java
Sidebar#<init>(Component /* title */)
```

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

```java
Sidebar#addViewer(Player);
Sidebar#removeViewer(Player);
```

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

```java
Sidebar.ScoreboardLine#<init>(String /* unique id*/, Component /* content */, int /* line */);

// For example
Sidebar.ScoreboardLine line = new Sidebar.ScoreboardLine(
        "some_line_0",
        Component.text("Hello, Sidebar!", NamedTextColor.RED),
        0
);
```

Once created, scoreboard lines may be added to `Sidebar`s as follows:

```java
Sidebar#createLine(Sidebar.ScoreboardLine);
```

Lines are indexed by their unique id, and can be modified with it:

```java
Sidebar#getLine(String /* unique id */);
Sidebar#updateLineContent(String /* unique id */, Component /* new content */);
Sidebar#updateLineScore(String /* unique id */, Int /* new score */);
```

## 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](/feature/advancements.md) page for more information on advancements.

```java
Notification#<init>(Component /* title */, FrameType, ItemStack /* icon */);

// For example
Notification notification = new Notification(
        Component.text("Hello, Notifications!", NamedTextColor.GREEN),
        FrameType.GOAL,
        ItemStack.of(Material.GOLD_INGOT)
);
```

To send the notification, use one of the static methods on `NotificationCenter`:

```java
NotificationCenter.send(Notification, Player);
NotificationCenter.send(Notification, Collection<Player>);
```

The example renders as the following:

![](https://190475541-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGf4sIoYQePTjMHJKdk4x%2Fuploads%2Fgit-blob-b88136a5ef6b1cf2cbefdec1ac38c085864319d4%2Fnotification.png?alt=media)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://wiki.microtus.dev/feature/player-capabilities.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
