Skip to content

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

EventTimingCancellableMutable fieldCancellation/effectRuntime path
SkillPreCastEventAfter condition, cooldown, and resource checks, before the skill effectYesNoneStops the effect, resource consumption, and cooldown commitCastAttemptService active/passive, cast, and castByTrigger paths
SkillPostCastEventAfter the effect succeeds and resources and cooldowns have been committed for the current sessionNoNonePost notification; cannot be rolled backSuccessful CastAttemptService.finalizeAttempt; not fired on failure or source loss
SkillPreUpgradeEventAfter upgrade validation, before charging and the rollYessuccessRateStops charging and the upgradeSkillUpgradeService
SkillUpgradeEventAfter the upgrade attempt result (success or failure) has been appliedNoNonePost notificationSkillUpgradeService
PlayerSkillSlotChangeEventBefore an equip, unequip, or bind-trigger writeYesNonePrevents the slot changeThe three state paths in PlayerSkillStateService

Event fields ​

EventRead-only fieldsWritable fields
SkillPreCastEventplayer, skillId, triggerIdcancelled
SkillPostCastEventplayer, skillId, triggerIdnone beyond the handler list
SkillPreUpgradeEventplayer, skillId, currentLevel, targetLevel, maxLevelcancelled, successRate
SkillUpgradeEventplayer, skillId, fromLevel, toLevel, successRate, success, downgradednone
PlayerSkillSlotChangeEventplayer, slotIndex, skillId, triggerId, actioncancelled

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 ​

  • SkillPostCastEvent carries only player, skillId, and triggerId, and is never cancellable
  • SkillPreUpgradeEvent is published before charging, so cancelling it produces no costs to refund
  • SkillUpgradeEvent is 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