Skip to content

Hooks

Hero Mancer fires hooks so other modules and macros can react to character creation, the approval workflow, and level-up. Every hook fires through Hooks.callAll under the heroMancer. namespace. Register a listener with Hooks.on, for example Hooks.on("heroMancer.Created", (data) => { ... }).

For programmatic access to Hero Mancer beyond these hooks, see the API reference.

HookWhen it firesCallback arguments
heroMancer.ReadyThe module is fully initialized, including approval, level-up, and socket registration.MODULE
heroMancer.documentsReadyCompendium entries for a document type have been fetched, normalized, and sorted. Consumers may push to promises to mutate entries before the final sort.type, entries, promises
heroMancer.WizardOpenedThe wizard window has finished its first render.{ app, fsm }
heroMancer.PreCreateThe base actor has been created, before advancements, items, and equipment are applied.{ actor, draft }
heroMancer.CreatedThe character is fully built, with equipment, summary, customization, and player assignment applied.{ actor }
heroMancer.ApprovalSubmittedA draft has been submitted to the Gamemaster approval queue.{ flagData }
heroMancer.ApprovalApprovedOn the submitter’s side, their submission was approved.{ pageId, payload, characterName, actorUuid }
heroMancer.ApprovalRejectedOn the submitter’s side, their submission was rejected. The payload allows the draft to be restored.{ pageId, reason, payload }
heroMancer.LevelUpStartedThe level-up window has rendered for an existing character.{ actor, app }
heroMancer.LevelUpCompletedA level-up has been committed to the actor.{ actor, newLevel }