Skip to content

Public API

Compile-time dependency

xml
<repositories><repository><id>emaki-public</id><url>https://repo.crypticlib.com/repository/maven-public/</url></repository></repositories>
<dependency><groupId>emaki.jiuwu.craft</groupId><artifactId>emaki-attribute-api</artifactId><version>4.7.11</version><scope>provided</scope></dependency>
kotlin
repositories { maven("https://repo.crypticlib.com/repository/maven-public/") }
dependencies { compileOnly("emaki.jiuwu.craft:emaki-attribute-api:4.7.11") }

Compile only — never install, shade, or relocate this jar

EmakiAttribute embeds these un-relocated API classes; a duplicate copy breaks event and bridge class identity.

Use EmakiAttributeApi.status().usable(), then catalog(), operations(), and extensions(). install, uninstall, and Bridge are runtime-only.

Catalog and operations

AttributeCatalog reads player attributes/resources, item and combat snapshots, resource definitions, attribute/damage ids, and item contribution-gate state. Player/entity/live-item methods require the appropriate owner thread. AttributeOperations provides consumeResource, owner-dispatched scheduleEquipmentSync, calculateDamage, applyDamage, and resyncPlayer; all other live combat/player work requires its documented owner thread.

Extensions and relocated packages

Third-party extension types are under emaki.jiuwu.craft.attribute.api.extension: AttributeContributionProvider, contribution/gate registrations, and ItemContributionGate. Registration is owner-scoped and allowed from any thread; close handles on disable. extensions().pdc() exposes the PDC access layer. Attribute Bukkit events are under emaki.jiuwu.craft.attribute.api.event, not the root API package.

Results

Use Success, Partial, Failure, and optionalValue() without collapsing business values into availability. Failure kinds are UNAVAILABLE, NOT_FOUND, INVALID_INPUT, REJECTED, CANCELLED, TARGET_OFFLINE, WRONG_THREAD, and INTERNAL_ERROR; no separate disabled kind exists.