English
Public API
Third-party plugins use emaki-codex-api to reach EmakiCodex's vanilla advancement layer (catalog(), operations(), and extensions())
Compile-time dependency
xml
<repositories><repository><id>jiuwu-releases</id><url>https://repo.crypticlib.com/repository/maven-public/</url></repository></repositories>
<dependency><groupId>emaki.jiuwu.craft</groupId><artifactId>emaki-codex-api</artifactId><version>1.1.5</version><scope>provided</scope></dependency>kotlin
repositories { maven("https://repo.crypticlib.com/repository/maven-public/") }
dependencies { compileOnly("emaki.jiuwu.craft:emaki-codex-api:1.1.5") }Compile only — never install, shade, or relocate this jar
EmakiCodex embeds this API unchanged; a duplicate copy breaks event and bridge class identity
Check EmakiCodexApi.status().usable() before use. The only non-null real layers are catalog(), operations(), and extensions(); install, uninstall, and Bridge are runtime-only. Codex works with registered Minecraft advancements and live advancement progress
The public API currently covers only the vanilla advancement layer. The category-entry codex (unlock, activation, and claim state from codex/*.yml) has no public API contract and is managed through commands, the GUI, and configuration; do not assume matching entry methods exist because advancement methods do
catalog() lists/lookups registered advancements and pages on any thread. completed(playerId, advancementId) reads live progress and needs the online player's owner thread. operations().grant and revoke are owner-thread writes and return EmakiResult<Unit>: no-op cases (an already-completed grant, an incomplete revoke) return FailureKind.REJECTED, unregistered or server-missing ids return NOT_FOUND, and cancellation returns CANCELLED; Codex public operations never produce Partial
extensions().registerAdvancement(owner, AdvancementSpec) registers an owner-namespaced advancement on the server global thread and returns an owner-cleaned registration. AdvancementSpec contains id, icon, title, description, frame, optional parent key, hidden, toast, and announce options. registerTrigger(owner, AdvancementTrigger) registers an owner-cleaned trigger; it receives AdvancementTriggerContext(player, triggerId, variables) on the player owner thread, must be fast, and returns advancement ids to grant (duplicates are collapsed)
Payload-free success uses EmakiResult<Unit>; the generic optional-payload accessor is optionalValue(). FailureKind has exactly UNAVAILABLE, NOT_FOUND, INVALID_INPUT, REJECTED, CANCELLED, TARGET_OFFLINE, WRONG_THREAD, INTERNAL_ERROR