The complete wiki can be found on the official GitHub page.
The following is a little example which creates an example advancement with a random description:
Code (Java):
public
class MainClass
extends JavaPlugin
implements Listener
{
private AdvancementTab advancementTab
;
private UltimateAdvancementAPI api
;
@Override
public
void onEnable
(
)
{
api
= UltimateAdvancementAPI.
getInstance
(
this
)
;
advancementTab
= api.
createAdvancementTab
(
"your_tab_name"
)
;
AdvancementDisplay rootDisplay
=
new AdvancementDisplay
(Material.
GRASS_BLOCK,
"Example", AdvancementFrameType.
TASK,
true,
true,
0,
0,
"A random",
"description."
)
;
RootAdvancement root
=
new RootAdvancement
(advancementTab,
"root", rootDisplay,
"textures/block/stone.png"
)
;
advancementTab.
registerAdvancements
(root
)
;
Bukkit.
getPluginManager
(
).
registerEvents
(
this,
this
)
;
}
@EventHandler
public
void onJoin
(PlayerLoadingCompletedEvent e
)
{
// Called after a player has successfully been loaded by the API
Player p
= e.
getPlayer
(
)
;
// Here you can show tabs to players
advancementTab.
showTab
(p
)
;
}
}
Result: