-
Notifications
You must be signed in to change notification settings - Fork 20
AdvancementDisplay
The AdvancementDisplay class stores information about the advancement graphic aspects. It stores:
| Value | Description |
|---|---|
| Icon | The itemstack that will be shown on the advancement GUI |
| Title | The title of the advancement, shown when a player hovers the advancement in the advancement GUI |
| Description | The description of the advancement, shown when a player hovers the advancement in the advancement GUI |
| Frame Type | The shape of advancement in the advancement GUI |
| x | The x coordinate of the advancement in the advancement GUI |
| y | The y coordinate of the advancement in the advancement GUI |
| Show Toast | Whether to show the toast when a player grants the advancement |
| Announce Chat | Whether to show the announce message on the chat when a player grants the advancement |
Let's see them in detail.
Advancements are displayed inside the advancement GUI based on two coordinates: x and y.
The advancement GUI can be thought as a positive Cartesian Plane (so x >= 0 and y >= 0), where the origin is fixed in the upper-left corner of the advancement GUI.
UltimateAdvancementAPI supports negative coordinates since 2.1.0 through the CoordAdapter class.
Note that the y-axis is going downwards
There are three possible frame types, enumerated in AdvancementFrameType:
| Frame Type | Result |
|---|---|
| Task | ![]() |
| Goal | ![]() |
| Challange | ![]() |
A toast is a notification that comes out at the top-right of the player screen when they complete an advancement:

Through the API it's also possible to send custom toast using
UltimateAdvancementAPI#displayCustomToast(...).
The announce message is sent to all online players on the server when someone completes an advancement. It is handled in the Advancement class by the method Advancement#getAnnounceMessage(Player player).
It prints a message which is like the vanilla one:

When it gets hovered the title and description of the advancement will be displayed:

Advancement#getAnnounceMessage(Player player)usesAdvancementDisplay#getChatTitle()andAdvancementDisplay#getChatDescription()to get the title and description to be displayed.
In addition to AdvancementDisplay, UltimateAdvancementAPI contains also the FancyAdvancementDisplay class, which should provide a fancier advancement.
The main differeces are:
| Feature | AdvancementDisplay | FancyAdvancementDisplay | Description |
|---|---|---|---|
| Title default color | Depends on the frame type | White (§f) |
In vanilla, the advancement title color is lime (§a) for tasks and goals, purple (§5) for challenges. FancyAdvancementDisplay sets it to white, while AdvancementDisplay follows vanilla. Default color doesn't obviously matter if the title line starts with a color code. |
| Description default color | Depends on the frame type | Light gray (§7) |
In vanilla, the advancement description color is lime (§a) for tasks and goals, purple (§5) for challenges. FancyAdvancementDisplay sets it to light gray, while AdvancementDisplay follows vanilla. Default color doesn't obviously matter if every description line starts with a color code. |
| Empty line between title and description in the completition chat message. | No empty line is added | An empty line is added if there isn't one already | Title and description can be separated by an empty line. That is automatically added by FancyAdvancementDisplay, while AdvancementDisplay never adds it. |
UltimateAdvancementAPI Wiki © 2021 fren_gor, EscanorTargaryen is licensed under CC BY-SA 4.0.
Except where otherwise noted, code snippets inside the wiki are licensed under The Unlicense.



