@vttforge/core / SystemRegistration
Interface: SystemRegistration ​
Properties ​
actorDataModels? ​
readonlyoptionalactorDataModels?:Readonly<Record<string,AnyClass>>
Map of documentTypes.Actor key → TypeDataModel class.
actorDocumentClass? ​
readonlyoptionalactorDocumentClass?:AnyClass
Replacement for CONFIG.Actor.documentClass.
combat? ​
readonlyoptionalcombat?:object
Global initiative formula: assigned to CONFIG.Combat.initiative.
initiative ​
readonlyinitiative:object
initiative.decimals? ​
optionaldecimals?:number
initiative.formula ​
formula:
string|null
enrichers? ​
readonlyoptionalenrichers?: readonlyEnricherRegistration[]
Text enrichers this system 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
System id: must match the folder name and system.json id.
itemDataModels? ​
readonlyoptionalitemDataModels?:Readonly<Record<string,AnyClass>>
Map of documentTypes.Item key → TypeDataModel class.
itemDocumentClass? ​
readonlyoptionalitemDocumentClass?:AnyClass
Replacement for CONFIG.Item.documentClass.
keywords? ​
readonlyoptionalkeywords?: readonlyKeyword[]
Rules terms this system defines. Each becomes @Keyword[id] in rich text, shown as its label with the description as tooltip, and all of them are written to a journal entry on the GM's client at ready. See Keyword.
keywordsJournal? ​
readonlyoptionalkeywordsJournal?:string|false
The name of the keywords journal. Default: the package title followed by "keywords". false registers the enricher and writes no journal.
onAfterInit? ​
readonlyoptionalonAfterInit?: () =>void
Optional post-init hook for work that depends on the mutations above.
Returns ​
void
onBeforeInit? ​
readonlyoptionalonBeforeInit?: () =>void
Optional pre-init hook for work that has to run before any of the CONFIG mutations (rare; usually used to assign globalThis.<systemId> API).
Returns ​
void
onI18nInit? ​
readonlyoptionalonI18nInit?: () =>void
Optional i18nInit hook. Fires after Foundry loads the language files and before setup.
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. Do it here instead, once, rather than localizing on every render.
Returns ​
void
Example ​
onI18nInit: () => {
for (const ability of Object.values(CONFIG.MY_SYSTEM.abilities)) {
ability.label = game.i18n.localize(ability.label);
}
},onReady? ​
readonlyoptionalonReady?: () =>void|Promise<void>
Optional ready hook. Fires once after Foundry has finished bootstrap. The natural home for migration runners (createMigrationRunner().run()).
Not GM-gated. Guard inside your callback (if (!game.user.isGM) return;) when the work is GM-only, and migrations always are.
Returns ​
void | Promise<void>
onSetup? ​
readonlyoptionalonSetup?: () =>void|Promise<void>
Optional setup hook. Fires after every package is loaded and before the canvas is drawn.
The home for work that init is too early for and ready too late: a setting registered during init can only be read from here on, and compendium packs are available. Keep world data out of it, that is onReady.
Returns ​
void | Promise<void>
sheets? ​
readonlyoptionalsheets?: readonlySheetRegistration[]
Sheets this system 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 system adds to CONFIG.statusEffects, each keyed by its id. An id that matches a core condition replaces it. The collection is never assigned wholesale: that would drop the conditions other packages added before this system's init ran.