MODDING DOCUMENTATION
Registries and dependencies
If you have used Forge, Fabric or another content-oriented mod loader, these concepts should be familiar. Forgotten Towns uses JSON for ordinary definitions and a small Java interface for the supported code extensions. It does not load Forge, Fabric, Harmony or their mod formats.
Registry
A registry is a named catalog of definitions. resources, recipes and placeables describe
different kinds of content. The operation's registry selects the catalog; the patch filename does not.
See the registry list for all routes and operation
restrictions. Other game JSON files are not implicitly writable.
Namespaced ID
New definitions use pack_id:local_name. This prevents unrelated packs from accidentally choosing
the same identity. Refer to existing base content with its existing ID, such as stone.
Food and equipment profiles instead use the existing resource's ID, even when adding a missing
profile to base content. A dependency is required when that resource belongs to another pack.
IDs are saved identities: do not casually rename them after releasing a pack.
Add, copy and patch
addintroduces an ID owned by your namespace.addwithcopyFromstarts from the source definition at that point in composition.patchchanges an existing ID. It cannot rename or delete the definition.
Objects merge recursively. Arrays are replaced in full. Explicit null only clears a value when the owning parser supports null. An empty object does not erase inherited options.
Copying a workstation preserves geometry and authored metadata; it does not automatically create a new Java behaviour. Some specialist systems still select particular built-in IDs. Test the behaviour you need rather than assuming an inherited tag activates a new system.
Dependencies and conflict handling
"dependencies": { "my_mod": "1.0.0" }
Declare this when referring to that pack's definitions, registered hooks or artwork. The loader requires the dependency to be present; a different version proceeds through compatibility validation. The manager can enable installed dependencies; it does not guess which Workshop subscription provides a missing ID.
Two packs can patch different fields on the same definition. If their writes overlap, the later writer must depend on the earlier one. Arrays count as complete field replacements. An added definition claims the complete entry. This makes overrides deliberate instead of silently losing changes.
Lifecycle
- Read the enabled profile and resolve dependencies.
- Capture immutable copies of pack files.
- Compose patches and register declared Java hooks.
- Validate the resulting registries, translations and artwork.
- Invoke the Mod API registry-ready callbacks with immutable composed definitions.
- Check colony factories with disposable empty-state restore and save/restore calls.
- Start the game with that frozen content.
Registration is startup-only. There is no hot reload. A content dependency exposes registered IDs, not another mod's Java implementation classes.
Names and descriptions in the manager
Optionally supply mods.your_mod.name and mods.your_mod.description in your pack's translation
catalogs. The manager reads the current language even while the pack is disabled. Without these
keys it displays the stable pack ID and a localized missing-description message. Do not add
unrecognized title or description fields to the manifest.
For new packs, prefer the separate about/ presentation folder. It supports a cover image and
translated descriptions without changing the gameplay hash. See mod presentation.
