@vttforge/core / ModuleRegistration
Interface: ModuleRegistration
Properties
actorDataModels?
readonlyoptionalactorDataModels?:Readonly<Record<string,unknown>>
Actor sub-types this module contributes, keyed by the bare type name. Registered under <id>.<type>, so declare them the same way in documentTypes.Actor in your manifest.
enrichers?
readonlyoptionalenrichers?: readonlyEnricherRegistration[]
Text enrichers this module contributes, registered under <id>.<enricher id>.
Register them here rather than pushing to CONFIG.TextEditor.enrichers yourself: that array has four ways to accept an entry and then do nothing with it. See registerEnrichers.
id
readonlyid:string
Module id: must match the folder name and module.json id.
itemDataModels?
readonlyoptionalitemDataModels?:Readonly<Record<string,unknown>>
Item sub-types, same rule as actorDataModels.
onAfterInit?
readonlyoptionalonAfterInit?: () =>void
Runs after the mutations above, inside the same init hook.
Returns
void
onBeforeInit?
readonlyoptionalonBeforeInit?: () =>void
Runs before any CONFIG mutation: the usual home for the module API.
Returns
void
onI18nInit?
readonlyoptionalonI18nInit?: () =>void
Runs on i18nInit, after Foundry loads the language files.
This is where CONFIG labels get translated. game.i18n is not loaded during init, so game.i18n.localize() called there returns the key you passed it, and the untranslated key is what players see.
Returns
void
onReady?
readonlyoptionalonReady?: () =>void|Promise<void>
Runs once on ready.
Not GM-gated. Guard inside your callback when the work is GM-only.
Returns
void | Promise<void>
onSetup?
readonlyoptionalonSetup?: () =>void|Promise<void>
Runs on setup, after every package is loaded and before the canvas is drawn.
For a module this is also the first point where the system it is extending has finished its own init, so it is the place to read what the system registered. A setting registered during init can only be read from here on. Keep world data out of it, that is onReady.
Returns
void | Promise<void>
sheets?
readonlyoptionalsheets?: readonlySheetRegistration[]
Sheets this module offers, registered under <id>.<sheet id>.
Register them here rather than calling Foundry's registerSheet yourself: Foundry derives the persisted key from the class name, and a bundler renames classes between builds. See registerSheets.
statusEffects?
readonlyoptionalstatusEffects?: readonlyStatusEffectConfig[]
Conditions this module adds to CONFIG.statusEffects, each keyed by its id. Prefix the id with the module id (my-module.dazed) so it cannot collide with the system's own. Added one by one, never assigned: the collection belongs to the system, and replacing it would delete the conditions the world depends on.