/
!Modrinth Downloads
AdvancementLib is a modern, fluent Java library for creating custom advancements in PaperMC Minecraft plugins.
It lets you easily register and manage advancements that respond to any Bukkit event, using a powerful builder-based API.
Add AdvancementLib as a dependency in your project using your preferred build tool or project setup method.
Note: Add the PaperMC repository if not already present.
import io.github.lambdaphoenix.advancementLib.AdvancementAPI;
AdvancementAPI api = new AdvancementAPI(plugin);
api.register(BlockBreakEvent.class)
.advancementKey("myplugin:break_10_stone")
.condition(
(player, event) -> event.getBlock().getType() == Material.STONE
)
.targetValue(10)
.grantMode(GrantMode.ALL_AT_ONCE)
.build();
ALL_AT_ONCE: Grants the advancement when the target is reached.STEP_BY_STEP: Grants one criterion at a time (shows progress bar in-game).api.register(CustomEvent.class)
.advancementKey("myplugin:custom_event")
.playerExtractor(event -> event.getWhoDidIt())
.build();
The latest Javadoc is automatically published to GitHub Pages:
➡️ View the Javadoc here
A small plugin library for custom advancement triggering.