Hero Mancer exposes a public API for module and macro authors. Access it through either of the following, which return the same object:
globalThis.HEROMANCER.api
game.modules.get('hero-mancer').api
The methods are grouped below by purpose. For lifecycle events you can subscribe to instead of calling these directly, see Hooks.
| Method | Behavior |
|---|
openWizard | Opens the character creation wizard, optionally pre-filling the character name. |
openWizardForPlayer | Intended to open the wizard for another user by id (see caution below). |
openLevelUp | Opens level-up mode for an existing character actor. Returns the application instance, or null if the actor is not a character. |
| Method | Behavior |
|---|
openPendingApprovals | Opens or focuses the Gamemaster pending-approvals queue. Returns the application instance. |
submitForApproval | Submits a character payload to the approval queue. Resolves to the created page id when run as the active Gamemaster, or null when the submission is routed to the Gamemaster over the socket. |
getPendingSubmissions | Returns pending submissions as journal pages, oldest first. |
| Method | Behavior |
|---|
saveDraft | Saves a wizard draft (a field map) for the current user. |
getSavedDraft | Returns the current user’s saved draft, or null. |
clearSavedDraft | Deletes the current user’s saved draft. |
| Method | Behavior |
|---|
reindexCompendiums | Rebuilds the cached index for an item subtype (race, class, background, subclass, or feat). Returns the result. |
getCompendiumEntries | Returns cached entries for an item subtype, either flat or grouped by top-level folder. |
findJournalPage | Resolves the journal page describing a document. Returns its uuid, or null. |
buildProficiencies | Computes render-ready proficiency categories (label, icon, and items) from race, class, background, and subclass documents. |
| Method | Behavior |
|---|
getInfo | Returns a diagnostic snapshot: version, enabled state, compatibility info, and last-seen version. |