English
Events
Item currently has five public events; the source contains no ItemUpdateEvent or EquipmentSkillTriggerEvent, so verify the class name before you reference one. Event package: emaki.jiuwu.craft.item.api.event
| Event | Timing | Thread | Cancellable | Mutable field | Cancellation/effect | Runtime path |
|---|---|---|---|---|---|---|
EmakiItemCreateEvent | After the factory has built the stack, before it returns to the caller | global-region owner thread | Yes | result, which must be non-null | Cancellation discards the result; public create returns CANCELLED | Creation paths that enter EmakiItemFactory and currently own the global region |
ItemRepairEvent | After repair validation, before charging and restoring durability | player owner thread | Yes | restoreAmount | Cancellation prevents both charging and repair; <= 0 also suppresses the repair | The material and economy repair services, including the economy path of the public repair() |
ItemSetBonusChangeEvent | After the active set count has actually changed | player owner thread | No | none | Post-notification, not rollbackable | Equipped set refresh, once per changed set id |
ItemStateChangeEvent | After an item-state mutation has been committed | the owner thread that performed the mutation | No | none | Post-notification, not rollbackable | The set/add/remove commit paths of state() |
ItemStateThresholdEvent | After a numeric item-state mutation crossed a configured threshold | the owner thread that performed the mutation | No | none | Post-notification, not rollbackable | Once per crossed threshold, after the commit and the once-threshold re-arm bookkeeping |
Boundary conditions: the creation event currently has a null player. When the calling thread does not own the global region, the runtime skips the creation event and still returns the detached build result, so this event is not a complete audit stream for every ItemStack creation. Migration and ordinary refresh dispatch no dedicated public events. ItemSetBonusChangeEvent is a post event; cancellation has no effect
Field contract: ItemStateChangeEvent exposes getItem() (a clone), getMutation(), getHolder() (null when the holder was unknown), and the getKey(), getOldValue(), getNewValue(), and getDelta() forwarded from the mutation
Field and dispatch boundary: ItemStateThresholdEvent exposes getItem(), getHolder(), getKey(), getOldValue(), getNewValue(), getThreshold(), getThresholdId(), getDirection() (UP/DOWN), isOnce(), and isRearmed(). It only covers numeric fields with configured thresholds (INTEGER, LONG, DOUBLE); an upward crossing dispatches once per threshold in ascending order and a downward crossing in descending order. It never fires for rejected or unchanged mutations, reserved meta. metadata keys, BOOLEAN and STRING fields, numeric fields without configured thresholds, changes that stay on the same side of a threshold, a once threshold still latched, or state restored verbatim by a rebuild