Warning: file_put_contents(/www/wwwroot/nmbt.106988770/cache/modrinth_versions_Lerd3Kd9.json): Failed to open stream: Permission denied in /www/wwwroot/nmbt.106988770/resource_detail.php on line 53
AdvancementLib - 墨喵 Minecraft 资源

AdvancementLib

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 0.3.2
本资源为搬运资源,原资源地址: https://modrinth.com/mod/advancementlib
资源信息

Minecraft 版本: 1.20.6 1.21 1.21.1 1.21.2 1.21.3 1.21.4 1.21.5 1.21.6 1.21.7 1.21.8

平台: paper

标签: library management utility

资源介绍

AdvancementLib

Javadoc
License
Java Version
PaperMC
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.

✨ Features

  • Register custom triggers: Listen for any Bukkit event (e.g., block break, entity death, player action) as an advancement trigger.
  • Custom conditions: Define your own logic to decide when an advancement should progress or be granted—perfect for unique gameplay challenges.
  • Support for vanilla & custom advancements: Grant both built-in Minecraft advancements and your own custom ones.
  • Progress tracking: Easily set multistep advancements (e.g., "break 100 blocks") with automatic progress tracking per player.
  • Builder API: Use a fluent builder to configure triggers, conditions, and progress logic.
  • Custom progress increments: Determine how much progress each event grants (default is 1, but can be customized).

🚀 Getting Started

1. Add as a Dependency

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.

2. Basic Usage

Register an Advancement
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();
Grant Modes
  • 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).
Custom Player Extractor
api.register(CustomEvent.class)
    .advancementKey("myplugin:custom_event")
    .playerExtractor(event -> event.getWhoDidIt())
    .build();

📚 API Highlights & Documentation

  • AdvancementAPI – Main entry point for registering advancements.
  • AdvancementRegisterBuilder – Fluent builder for all advancement options.
  • GrantMode – Enum for grant behavior: all at once or step-by-step.
  • PlayerExtractor – Interface for mapping any event to a Player.

The latest Javadoc is automatically published to GitHub Pages:

➡️ View the Javadoc here

下载与版本
评论(0)
请 登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

赞助作者

请 登录 后赞助作者。

🔥 相关推荐
PotatoCannon

价格:0 墨喵币
下载量:0

查看详情
AirDropSpigot

价格:0 墨喵币
下载量:0

查看详情
Shulker Preview

价格:0 墨喵币
下载量:0

查看详情
ProxLib

价格:0 墨喵币
下载量:0

查看详情