-
Notifications
You must be signed in to change notification settings - Fork 7
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.
The toast is the notification that comes out at the top right when you complete an advancement.
An example:
Through the API it is also possible to send custom toast. Use the method UltimateAdvancementAPI#displayCustomToast()
This message is sent to all online players on the server when someone completes an advancement. There is a default message which is similar to the vanilla one:
If you go over the name of the advancement, the title and description of the advancement will be displayed:
To customize the hover message override Advancement#getAnnounceMessage() method and return a BaseComponent[]
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.