English
Events
Skills events live in emaki.jiuwu.craft.skills.api.event and are always published synchronously on the owning player's thread. Asynchronous cast entry points hop back to that owner thread before publishing. Pre events are cancellable; post events are informational and fire after their corresponding commit
| Event | Timing | Cancellable | Mutable field | Cancellation/effect | Runtime path |
|---|---|---|---|---|---|
SkillPreCastEvent | After condition, cooldown, and resource checks, before the skill effect | Yes | None | Stops the effect, resource consumption, and cooldown commit | CastAttemptService active/passive, cast, and castByTrigger paths |
SkillPostCastEvent | After the effect succeeds and resources and cooldowns have been committed for the current session | No | None | Post notification; cannot be rolled back | Successful CastAttemptService.finalizeAttempt; not fired on failure or source loss |
SkillPreUpgradeEvent | After upgrade validation, before charging and the roll | Yes | successRate | Stops charging and the upgrade | SkillUpgradeService |
SkillUpgradeEvent | After the upgrade attempt result (success or failure) has been applied | No | None | Post notification | SkillUpgradeService |
PlayerSkillSlotChangeEvent | Before an equip, unequip, or bind-trigger write | Yes | None | Prevents the slot change | The three state paths in PlayerSkillStateService |
Event fields
| Event | Read-only fields | Writable fields |
|---|---|---|
SkillPreCastEvent | player, skillId, triggerId | cancelled |
SkillPostCastEvent | player, skillId, triggerId | none beyond the handler list |
SkillPreUpgradeEvent | player, skillId, currentLevel, targetLevel, maxLevel | cancelled, successRate |
SkillUpgradeEvent | player, skillId, fromLevel, toLevel, successRate, success, downgraded | none |
PlayerSkillSlotChangeEvent | player, slotIndex, skillId, triggerId, action | cancelled |
PlayerSkillSlotChangeEvent.Action enum values: EQUIP (a skill is equipped), UNEQUIP (the slot is cleared), BIND_TRIGGER (a trigger is bound). Fields vary with the action: on UNEQUIP, skillId is the previously bound skill id, and triggerId is non-null only for BIND_TRIGGER
Boundaries
SkillPostCastEventcarries only player, skillId, and triggerId, and is never cancellableSkillPreUpgradeEventis published before charging, so cancelling it produces no costs to refundSkillUpgradeEventis published after the level (or the failure penalty) has been applied; listeners can observe but cannot change the result- Script actions and external skill-source providers are extension execution points: registering one does not by itself fire events. Only operations that actually enter the central cast/upgrade/slot services publish these events
- Events are called synchronously by the plugin; listeners must not block inside them or touch Bukkit state owned by another entity