Skip to content
3 Death Saves
Wiki updated as of 3.3.0 (Sep 2026)

Hooks

Hero Mancer fires its hooks with Hooks.callAll under the heroMancer. prefix. Listen with Hooks.on, for example Hooks.on("heroMancer.Created", ({ actor }) => { ... }). Public methods are listed in the API reference.

HookWhen it firesCallback arguments
heroMancer.ReadyDuring Foundry’s ready hook, after Hero Mancer registers its sockets and listeners.MODULE
heroMancer.documentsReadyCompendium entries for an item type have been fetched and sorted.type, entries, promises
heroMancer.WizardOpenedThe wizard window finishes its first render.{ app, fsm }
heroMancer.PreCreateThe base actor exists, before its items and advancements are applied.{ actor, draft }
heroMancer.CreatedThe character is fully built.{ actor }
heroMancer.ApprovalSubmittedA draft is submitted to the approval queue.{ flagData }
heroMancer.ApprovalApprovedThe current user’s submission was approved.{ pageId, payload, characterName, actorUuid }
heroMancer.ApprovalRejectedThe current user’s submission was rejected.{ pageId, reason, payload }
heroMancer.ApprovalReceivedA submission page is added to the pending queue, including startup recovery and archive restores.{ page, flagData, restored }
heroMancer.ApprovalResolvedA pending submission is approved or rejected, before its page is archived or deleted.{ pageId, outcome, flagData, rejectionReason }
heroMancer.LevelUpStartedLevel-up mode opens for a character, before the window finishes rendering.{ actor, app }
heroMancer.LevelUpCompletedA level-up is committed to the actor.{ actor, newLevel, spellcasting, details }

heroMancer.documentsReady passes a promises array. Push promises to it to hold the final sort until your async changes to entries finish.

draft on heroMancer.PreCreate is the advancement pick map. If the build fails after this hook, the actor is deleted and heroMancer.Created does not fire.

payload on heroMancer.ApprovalApproved is always null, so use actorUuid to find the created actor. On heroMancer.ApprovalRejected, payload is the submission as a JSON string.

restored on heroMancer.ApprovalReceived is true only for pages restored from the archive.

heroMancer.LevelUpCompleted carries two detail objects. spellcasting compares the actor before and after the level, with firstCaster, previousMaxSpellLevel, newMaxSpellLevel, previousCantrips, and newCantrips. details lists what the level granted, with className, hitPoints, abilities, and items. newLevel is the new level in the class that gained the level, not the character’s total level.