Minestom wiki
Search…
Advancements
The advancement API is based around AdvancementTabs which represent a tree of Advancements for one or more players. Each player viewing a single AdvancementTab will see the same progress as all of the others. If per player Advancements are needed, individual AdvancementTabs will need to be created.
Advancements represent a completable advancement in an AdvancementTab.

AdvancementTab

AdvancementTabs can be created and retrieved from the AdvancementManager.
1
// Create
2
AdvancementManager#createTab(String /* namespaced id */, AdvancementRoot);
3
4
// Retrieve
5
AdvancementManager#getTab(String /* namespaced id */);
Copied!
Namespaced IDs follow the format of namespace:id, and may not have any upper case letters.
An AdvancementRoot is the origin Advancement for a tab, and has the same creation method as a regular Advancement (see below) with the exception of the background. A background is a reference to a texture file on the client, for example minecraft:textures/block/stone.png for stone block.
1
AdvancementRoot#<init>(Component, Component, Material, FrameType, int, int, String /* background */);
Copied!
Once created, an AdvancementTab may be added and removed from players as follows:
1
AdvancementTab#addViewer(Player);
2
AdvancementTab#removeViewer(Player);
Copied!

Advancement

Advancements can be created with their constructor and added to an AdvancementTab with an associated parent.
1
Advancement#<init>(Component /* title */, Component /* description */, Material, FrameType, int /* x */, int /* y */);
2
3
AdvancementTab#createAdvancement(String /* namespaced id */, Advancement /* to add */, Advancement /* parent */);
Copied!
The parent of an Advancement may not be null, and it must have been added to the tab already. The AdvancementRoot is a valid parent.
Once an Advancement is registered, it can be completed.
1
Advancement#setAchieved(Boolean);
Copied!
To make an advancement show a toast, use Advancement#showToast(Boolean) before setting it to achieved.
Last modified 29d ago
Copy link