FORGOTTEN TOWNS

FORGOTTEN TOWNS / MODIFICACIÓN DE DOCUMENTACIÓN

Wiki de modificación ↗

Java Referencia API (Javadoc)

MOD API 15

Navega por la wiki

Documentación actual de Mod API.

La documentación técnica está disponible en inglés. Los nombres de código y campo siguen la API Mod actual.

MODIFICACIÓN DE DOCUMENTACIÓN

JSON field explanations

Scenario additions use four registries: campaignStages, quests, campaignBootstraps, and ambientScenes. They use owned cN_<mod_id>_* identities and native authored-content validation, separately from the fourteen Java definition catalogs. See the scenario schema and runnable example.

JSON-only instructions · Field index · Asset reference · Accepted top-level fields · Base ID lookup

This reference covers the exposed mod registries, not every JSON document shipped by the game. Every table below describes fields inside an operation's values, unless a nested path is stated. id belongs to the operation, including for essences whose internal identity field is called key. Names are supplied by translations, never displayName in a patch.

Existing quest lessons

questStages supports only op: "patch", with id: "questId/stageId". Its values may contain titleKey, bodyKey and a replacement objectives array. Stable stage IDs, order, rewards and execution actions remain owned by the campaign. Supply objective labels in every locale; campaign objective IDs must keep their cN_ namespace. Overlapping patches require an explicit dependency on the earlier pack. See Shared Quarters.

HAS_ZONE_INSTANCES and HAS_ASSIGNED_ZONE accept minTiles, minBeds and maxBeds. These bounds apply per room. Disjoint bed ranges can distinguish shared and private rooms. COMPLETED_WORK_ORDER accepts an optional exact featureId filter. WORLD_FEATURE guidance links target an explored, harvestable feature definition and only move the camera and show a marker.

Defaults apply to a new definition with no copied value. With copyFrom, omitted values retain the source value. Objects merge recursively and arrays replace. null is not a universal delete operator: only use it where that registry accepts an absent optional value. A field being optional does not mean every explicit null is accepted. Prefer omission for new definitions.

Samples are complete manifest-listed patch arrays. Smaller JSON blocks in this reference are structural excerpts; follow their links for installable context.

Resources

Sample: starter resources. Minimal patch: JSON-only stack change.

New resources require resources.your_mod:local_id in every language. Copy an existing resource when its icon and storage behavior are appropriate; override the fields that differ.

Field Type / default Effect and authoring rule
spritePath Optional PNG path Standalone icon; clear an inherited path when switching to atlas artwork
spriteSheetPath Optional PNG path Resource atlas with 64 × 64 cells; supply column and row together
spriteSheetColumn, spriteSheetRow Integers ≥ 0 when using an atlas Zero-based cell indices, not pixel coordinates; the entire selected cell must fit
stockpileZoneId Existing zone ID; resource_stockpile Primary storage category
additionalStockpileZoneIds Array of zone IDs; [] Additional permitted storage categories
foodValue Integer ≥ 0; 0 Legacy food metadata; an existing food profile takes precedence
tradeValue Integer ≥ 0; category-derived when absent Trading metadata; food profiles and downstream valuation rules can affect effective value
stackSize Integer ≥ 0; 0 Positive value overrides stack capacity; zero delegates to category defaults
discoverable Boolean; true Whether the resource participates in ordinary resource discovery
artifact Boolean; false Protects an irreplaceable item from sale, destruction and loss between campaigns

A resource definition does not automatically add resource-family membership, equipment stats, a food profile, world deposits, loot or recipes. Use the linked gameplay registries and recipes to provide those behaviors. Existing IDs in base-ids.json are the current authored catalog; dynamic imbued resources are generated at runtime and are not all listed there.

Recipes

Samples: ordinary recipe and nested recipes. Name key: recipes.your_mod:local_id.

Field Type / default Effect and authoring rule
disciplineId Required existing discipline ID Crafting category and existing worker rules; e.g. utility
workstationId Optional existing placeable ID A station eligible for the recipe
workstationTagOptions Array of tags; [] Expands matching placeables into eligible alternatives; author a tag on your custom station
requiredZoneId Optional existing zone ID Required work-zone context
requiredFeatureId Optional existing world-feature ID Existing feature-bound work requirement; not a feature-definition hook
workTicks Positive integer; 22 Single-stage work duration; author explicitly for predictable balance
steps Array of step objects Explicit ordered station stages; see below
ingredients Array of ingredient objects One ingredient bundle
ingredientOptions Array of ingredient bundles Alternative complete bundles; not a list of additional required bundles
ingredientFamilySelection Object Combinations of distinct members from an existing resource family
outputResourceId Optional resource ID Normal output; ordinary production recipes should declare it
outputAmount Positive integer; 1 Normal batch quantity; existing profession production bonuses may apply
randomOutputs Array of random-output objects; [] Independently rolled extra outputs on successful ordinary crafting
failureEffect Optional object Existing burn-and-lose-batch behavior
unlock Optional object Discovery gates; four supported list fields below

Use one ingredient form. In particular, ingredientFamilySelection cannot coexist with either ingredients or ingredientOptions, even if an inherited field is patched to null. Because merge cannot remove a field, author this variant from scratch rather than copying a recipe containing the incompatible form. Root workstationOptions, additionalWorkstationIds, direct unlock lists and the document-level workstationRandomOutputs are not exposed by the current mod field set. For alternatives use station tags, or the supported nested step options.

Ingredients and family selection

An ingredient has exactly one selector and a positive integer amount:

{"resourceId":"quartz","amount":1}
{"familyId":"any_log","amount":2}

ingredientOptions wraps complete lists, for example [[{"resourceId":"stone","amount":2}],[{"resourceId":"quartz","amount":1}]]. The Mod API’s families registry can add families or patch their member lists. An ordinary family ingredient can use members of that family; use distinct selection when the recipe must consume different kinds:

{
  "familyId": "any_log",
  "distinctTypes": 2,
  "amountPerType": 1
}

distinctTypes is 1-4 and cannot exceed the available family members. amountPerType is 1-99. The second recipe in the add-on is a complete example with no incompatible ingredient fields.

Steps

Nested field Type / default Meaning
workstationId Optional placeable ID One station for this stage
workstationOptions Array of placeable IDs Explicit alternative stations for this stage
workstationTagOptions Array of tags Matching station alternatives for this stage
workTicks Positive integer; 115 Duration of this stage
fuelUnits Nonnegative integer; 1 Fuel units used by a fuel-consuming stage; zero for no fuel

Author the station selector explicitly. The sample routes preparation through mason_bench, then finishes at a station with my_mod_crystal_station. Preserve practical worker access to both. The internal parser understands step display labels, but inline displayName is forbidden in mod patches, including nested objects; omit it. No per-step localized label hook is exposed yet. Work ticks use 30 simulation ticks per second and exclude logistics and worker waiting.

Random output and failure objects

randomOutputs[] field Meaning
resourceId One existing output resource, or use resourceOptions
resourceOptions Nonempty resource-ID list from which one is chosen on that output roll
chancePercent Integer 0-100; default 100
amount Positive integer shorthand for a fixed amount; default 1
minAmount, maxAmount Integer output range, with 1 ≤ min ≤ max; use instead of the shorthand

Each entry has its own roll; chance values are not weights that must total 100. Normal output is separate. Do not rely on out-of-range values being clamped by legacy parsers.

failureEffect field Meaning
type Existing supported effect burn
chancePercent Integer 0-100; default 100
durationSeconds Positive duration for an active burn; default 0
damagePerTick Positive damage for an active burn; default 0
intervalSeconds Positive damage interval; default 0
eventKey Localized failure-message key; absent/blank uses event.crafting.failed

When this failure triggers, the job applies the burn, completes without normal or random output, and does not refund consumed inputs. The failure message receives worker name and location as format arguments {0} and {1}. A string other than burn does not create a new effect type.

Recipe unlocks

unlock accepts anyDiscoveredResources, allDiscoveredResources, anyDiscoveredFamilies and allDiscoveredFamilies, each an array of existing IDs. An any list requires a matching discovery; an all list requires every listed discovery. Omitted/empty lists add no requirement. Separate populated categories contribute their requirements together. These are discovery conditions, not a way to define new quest objectives or emit events.

Placeables

Samples: inherited workshop, storage and crafted resource, own-atlas patch. Name key: placeables.your_mod:local_id.

From scratch, provide footprint width/depth, height, a capabilities object and usable sprite metadata. Workstations must explicitly declare their construction preparation route. Copying an existing station preserves its authored sprite-to-facing mapping, anchors and access positions.

Field Type / default Meaning
buildCategory Existing menu category string Common values include workstations, decorations, furniture, stockpiles; does not create a new menu
buildCost Ingredient array; empty if omitted Resource or family cost, using the ingredient shape above
buildPreparationWorkstationIds Ordered station-ID array Required for category workstations; [] means direct construction; references must resolve and preparation dependencies must be acyclic
footprintWidth, footprintDepth Required positive integers Logical occupied dimensions in tiles, separate from artwork dimensions
heightBlocks Required integer ≥ 0 Physical height; zero supports floor-style placeables
occupiedHeightBlocks Integer; defaults to heightBlocks Occupancy height when different from the visual/object height
fullBlockOccupant Boolean; false Existing full-block occupancy behavior
stackable Boolean; false Existing stacked placement behavior
occupancyModel legacy_rect or anchored_rect Rectangle/anchor handling; defaults to legacy behavior
capabilities Required object Selectability, movement, pickup, harvest and actor occupancy flags
spriteAtlasPath PNG path Atlas used by facingSprites
facingSprites Object keyed by logical cardinal direction Image crops, anchors, offsets and work positions; see nested reference
foregroundSpriteAtlasPath Optional PNG path Existing foreground layer using matching region coordinates
modalIconKey Existing typed HUD icon key For a resource use resource:your_mod:item; icon semantics depend on the UI consumer
gameplayTags String array; [] Existing semantic tags, or custom tags selected by recipe station-tag options
requiredZoneId Optional existing zone ID Required zone on the footprint and every worker/recipient standing tile
requiredSurfacePlaceableId Optional placeable ID Required built surface below the footprint and every worker/recipient standing tile
requiredSurfacePlaceableIds Placeable-ID array Alternative permitted surfaces
requiredFacingBlockTag Optional existing block tag Existing terrain-facing requirement
fuelFamilyId Optional resource-family ID Existing fueling behavior
liquidSourceBlockType Optional existing block-type enum name Existing source-liquid behavior; use an actual game block type
plantedWorldFeatureId Optional world-feature ID Existing feature planted by placeable construction; does not define a new feature
renderRole Optional existing role, e.g. banner Selects existing rendering behavior; arbitrary strings do not add a renderer
storage Optional object Storage category, capacity and preservation
craftedResource Optional object Inventory resource and generated crafting recipe for supported crafted placeables
decorationValue Integer; 0 Nearby decoration contribution; normalized to −20…20
decorationRadius Integer ≥ 0; 0 Radius in tiles of nearby decoration
tileDecorationValue Integer; 0 Local tile contribution; normalized to 0…20
fireEmissionRadiusTiles Nonnegative integer; 0 Existing fire-emission radius
workstationRange Optional object Existing station range controls and auto-replant option
ambientParticles Optional object Floor orbs: hex color, integer count (1-32), and risePixels (1-64; default 24); see below
spriteParticles Optional object Named sprite-attached emitters; see socket and particle authoring
renderScale Finite positive number; 1 Visual size multiplier; does not change occupancy, work positions or support anchors
lightningConductor Optional object Existing storm interception, stored charge and optional defense; see below
unlock Optional object Discovery, placed-object and existing-event requirements

Root spritePath is not currently mod-exposed even though the internal placeable parser has a reader for it. Use atlas definitions. Zone and floor requirements also cover the station's work tiles. liquidSourceDisplayName appears in base data but inline display text is forbidden in mod patches; there is no new liquid-label authoring field in this API. Copying a liquid source retains its existing authored behavior and label.

ambientParticles emits the configured number of rising orbs per placed floor tile. Arcanum uses {"color":"#B16BFF","count":8,"risePixels":22}. Effects use the placed floor's visibility and occlusion, pause with gameplay, and are bounded to 4,096 visible ambient orbs per frame. They do not alter terrain geometry. Use this field on single-tile floors; it does not distribute emitters over a larger furniture footprint. The runtime supplies its own ambient_particles index tag.

A fresh capabilities object must include boolean selectable, movable, pickupable and harvestable; actorOccupancy is an optional boolean defaulting to false. Flags invoke existing systems; they do not provide new drop tables, animations or interaction callbacks. Check copied objects in game, especially machines whose consumers still recognize built-in IDs.

The capabilities, storage and workstationRange objects validate their nested names and JSON types before composition. Numeric range/storage fields must be signed 32-bit integers, not strings or fractional numbers. Partial objects inherit unspecified members. Required capability flags cannot be cleared; storage: null and workstationRange: null explicitly remove those optional components.

Facing sprites, anchors and work positions

facingSprites keys are south, north, west, east. A single-facing object can supply only south. For new four-direction art, author cells left-to-right in south, north, west, east order and explicitly map the keys. Preserve original mappings when reusing legacy art.

Facing field Meaning
x, y Required nonnegative pixel position of the crop's top-left corner
width, height Required positive pixel size of the crop
anchorPixelX, anchorPixelY Required integer anchor relative to the crop
alternateFrame Optional second region with the same six crop/anchor fields
variantFrames Optional array of regions with the same six crop/anchor fields
occupiedOffsets Array of {x,y} logical tile offsets defining occupied cells
blockingOffsets Array of {x,y} tile offsets for movement blocking
placementClearanceOffsets Array of {x,y} tile offsets that must remain available for placement
workSlots Array of worker/recipient positions described below
requiredAttachmentSide Optional north, west, east or south adjacent wall/ledge side

The six crop fields are required in every supplied alternate/variant region; they inherit the atlas path, not missing coordinates. These fields supply frames to existing behavior, not a new animation timeline, frame rate or scripting hook. Alternate state selection and variation remain controlled by the game.

Tile offsets are integers in logical tile space and may be negative. They are not atlas coordinates. A work slot has required standOffset:{x,y} and faceOffset:{x,y}, optional integer priority (default 0; lower sorts first), and optional role (worker by default, or recipient). Both roles reserve access; only worker slots count toward ordinary crafting capacity. Rotation of footprints and anchors is separate from the sprite's cardinal meaning. See the full asset guide and explicit atlas example.

Storage, crafted resources, range and unlocks

storage field Meaning
stockpileZoneId Existing storage zone/category ID
slotCount Nonnegative integer storage slots; default 0
preservationValue Integer preservation metadata; default 0

Storage still uses the game's existing stockpile and container logic. The add-on's cabinet copies the Food Crate and switches its storage category to resource_stockpile. Copying a category does not extend the zone registry or create custom filter controls.

craftedResource field Meaning
kind craftsmanship or decoration
resourceId Optional inventory identity; omit/null for crafted_placeable_ plus the full placeable ID
craftingDisciplineId Optional existing discipline override; otherwise derived by existing crafted-resource behavior
stockpileZoneId Optional existing category override
additionalStockpileZoneIds Additional storage categories; defaults to an empty list
spriteSheetPath Resource icon atlas PNG, using 64-pixel cells
spriteSheetColumn, spriteSheetRow Zero-based nonnegative icon cell indices

For an inherited crafted placeable, replace or clear its copied resourceId to avoid sharing the base object's inventory identity. The add-on token produces a generated resource owned by crystal_addon, with an identity starting crafted_placeable_crystal_addon:. Its localized name comes from the associated placeable. The engine derives a crafting route from existing crafted placeable rules, tags and materials; this object does not define arbitrary per-stage operations. Generated resource/recipe identities are runtime products and are not necessarily patchable registry entries during composition. Author the placeable rather than attempting to patch a not-yet-generated entry. A reference to another pack's generated resource still requires that owner as a dependency.

workstationRange accepts integer maxTiles (default 100), integer defaultTiles (default maxTiles) and boolean supportsAutoReplant (default false). Use positive ranges with the default no larger than the maximum. This configures existing range-aware stations, not arbitrary new AI.

lightningConductor requires positive integer radiusTiles and capacity. Optional strikeAnchors maps each facing (south, north, west, east) to a sprite-local {x,y} pixel coordinate. Optional maxHealth is a nonnegative integer, default 0. Its optional attack object enables the existing charged defense: positive integer intelligence, integer intervalSeconds (1-3600), positive integer rangeTiles, optional positive integer forkRangeTiles (defaults to the shared lightning jump range), integer forkStages (1-3), and positive integer raidSoldierLevel. These fields configure the conductor mechanic; they do not register a new attack implementation.

unlock accepts the same four discovery arrays as recipes, plus requiredPlacedPlaceableIds and requiredEventIds. The first references placeables that must exist; the second refers to events the game already produces. Listing an event ID does not create that event. Check inherited unlock arrays: an empty object merges and will not clear a copied campaign-event requirement.

Essences and imbuements

Sample: crystal essence. Balance patch: dependent modifier change. Name key: essences.your_mod:local_id; the referenced resource has its own resource name key.

Field Type / default Meaning
resourceId Required resource ID Material consumed to apply this essence; each essence needs a unique resource binding
imbuingWorkstationId Required placeable ID Station for existing generated imbuement recipes
workstationEmitterId Optional emitter ID Selects an existing named socket in the workstation's spriteParticles; see socket authoring
supportedSlots Array of slot IDs Use a nonempty list of helmet, armor, weapon, shield, cloak
statModifiers Object; {} Existing finite numeric modifiers, listed below
capabilities String array; [] Existing capability flags; soul_resurrection is currently consumed; arbitrary flags add no behavior
weaponGlow Optional object Existing handheld/item particle color, count and profile selection
requiresExpeditionerForDiscovery Boolean; false Existing Expeditioner discovery gate; separate from workstation qualification
campaignDiscovery Optional object titleKey and bodyKey for the existing discovery presentation; localize both
elementAffinity Optional combat element Existing elemental drop selector; AIR, FIRE, FROST, EARTH
creatureTags String array; [] Matches tags already carried by game creatures for essence drop selection
humanoidFallback Boolean; false Existing default humanoid essence selector; only one may be enabled globally
upgradeOf Optional essence key Existing level-dependent drop upgrade; declare with positive minimumDropLevel
minimumDropLevel Nonnegative integer; 0 Positive threshold paired with upgradeOf
exclusiveDeathMark Optional mark string Existing exclusive death-drop selector; cannot combine with upgradeOf

The engine creates eligible imbued item IDs and imbuement recipes using existing equipment stats. An essence does not define a new base weapon or a new gear slot. The crystal sample has no drop selector and is obtained by recipes/conversion; that is a valid authored design.

Numeric modifiers

All values must be finite JSON numbers. These are existing formula inputs, not arbitrary stat names. A missing additive modifier is zero. Final combat and equipment rules may clamp totals or apply modifiers only to the relevant type of attack; adding a modifier does not create that attack.

Key Meaning / units
damage Flat physical equipment damage bonus
spellPower Flat spell-power bonus
armor Flat armor bonus
armorPercent Percentage armor bonus
armorPenetrationPercent Armor-penetration percentage bonus
dodgeChance Dodge chance percentage-point bonus
critChance Critical chance percentage-point bonus
hitChance Hit chance percentage-point bonus
blockChance Block chance percentage-point bonus
movementSpeed Movement speed percentage bonus
maxHp Flat maximum-health bonus
healthPercent Percentage maximum-health bonus
critDamagePercent Critical damage percentage bonus
terrorChancePercent Existing terror proc percentage bonus
attackAccuracyMultiplier Multiplies the base attack accuracy factor; neutral value 1, not 0
attackCooldownTicks Added attack cooldown ticks, rounded to an integer; positive values lengthen the delay
attackDodgeChanceBonus Dodge chance percentage-point bonus while the citizen is in the attack animation
attackKnockbackChance Knockback chance percentage-point bonus for existing eligible attack knockback checks
elementalBonusIntScaling Added scaling coefficient for an existing elemental attack's intelligence contribution
lifeStealPercent 0-100 percent of actual direct attack health damage restored

Keep multiplier and scaling coefficients distinct from percentage-point bonuses. Lifesteal currently sums equipped weapon and shield values and caps the total at 100%. Misses and health not actually removed do not heal; overkill does not inflate healing. Secondary procs and damage-over-time ticks do not trigger it. Lifesteal does not imply resurrection; resurrection is the separate capability above.

elementAffinity selects essence drops, not a new attack damage type. Adding an elemental scaling modifier cannot supply missing elemental equipment stats. capabilities cannot add a new stat formula or on-hit script; those are not exposed hooks.

Glow and drop selectors

weaponGlow accepts:

Nested field Meaning
colors 1-3 distinct #RRGGBB strings; required for a glow object
orbCount Integer 1-16; author explicitly for predictable density
particleProfileId Optional registered particle-profile ID; omission uses existing ordinary particles

When orb count is omitted, the game's root weaponGlowDefaults derives it from palette size. That root object and root dropRules are not mod registry entries. Custom profiles reuse the existing equipment attachment pixels; enabling a clothing slot does not invent particle anchors.

Only one essence may claim a given elementAffinity. Only one may be the humanoid fallback, only one upgrade may target a given base essence, and exclusive death marks must be unique. A copied essence often inherits one of those selectors: clear it if creating a recipe-only variant. Do not copy Fire's affinity into a new essence and leave both globally assigned to Fire.

Element aliases accepted by existing parsing include Wind → Air, Ice/Cold → Frost and Nature/Stone → Earth. Use canonical names in new examples. Void, Soul and Construct are not additional values of the four-element combat enum; their essence selection uses other existing metadata. A custom creature tag or death mark has no effect unless the existing game actually supplies it. The discovery object can configure an existing prompt, not add campaign stages or scenes.

Equipment transforms

Sample: starter conversion. Java: StarterMod.

Each profile defines the supported conversion operation for one station. All fields except particleProfileId are required in a new definition. Unknown profile and rule fields are rejected.

Field Type / range Meaning
workstationId Placeable ID Station owning this profile; only one profile may claim a station
qualificationWorkstationId Placeable ID Existing specialist qualification alias, e.g. essence_smithy
handlerId Registered hook ID essence_extraction for the built-in chance roll, or your Java handler
workTicks Integer 1-360,000 Duration of the conversion work
supportedSlots Nonempty slot-ID array Eligible gear slots; same five IDs used by essences
rules Nonempty array One explicit output/chance rule per eligible essence
excludedEssences Essence-key array Explicitly excluded essences; cannot overlap the rules
requireEssenceCoverage Boolean Whether every loaded essence must be mapped or explicitly excluded
labelKey Translation key Action label, required in all languages
introKey Translation key Instruction/destruction explanation, required in all languages
particleProfileId Optional profile ID Existing station conversion effect's particle style

A rule has exactly essenceKey, outputResourceId and integer successPercent in 0-100. Duplicate essence rules are invalid. Both referenced definitions must exist. With coverage false, unlisted essences simply cannot be selected. With coverage true, every loaded essence - including trinket essences and essences from other enabled mods - must appear in rules or exclusions. A compatibility add-on may need to replace those arrays when combining content packs.

The input must be stored, unequipped, imbued equipment in a supported slot and with a matching rule. An unimbued weapon cannot be converted through this profile. The engine consumes one selected item on completion whether the handler succeeds or fails. Success yields one configured resource; there is no JSON output count, secondary-output list, refund or consume-on-success flag. An ordinary recipe's ingredient and random-output fields do not apply here.

Qualifications use an existing station as an alias; this does not create new professions or a qualification editor. Registration and rule resolution are shared mechanisms. No station ID or essence ID needs to be hardcoded in the game for a new mod using them.

Particle profiles

Sample: starter profile. Polygon: starter Java class. All six values fields are required; unknown fields are rejected.

Field Type / range Meaning
shapeId Registered polygon ID Shape supplied by a loaded Java mod
lifetimeSeconds Number 0.1-2 Particle lifetime
travelPixels Number 0-16 Travel distance in native pixels
radiusPixels Number 0.5-3 Polygon scale in native pixels
trailCount Integer 0-4 Bounded trailing shape copies; zero disables trails
brightness Number 0.1-1 Brightness control within the existing renderer

Native pixel dimensions scale with the game's zoom. Essence glow defines color and particle density separately. A profile does not contain emission rate, blend mode, texture, gravity, shader source or arbitrary attach-point definitions. Motion and trails remain bounded by the engine's shared renderer behavior.

The base profile catalog is empty in this version, so a fresh custom profile needs a shape registered by a mod. To make an entirely JSON-only imbuement with no code dependency, omit particleProfileId and use ordinary glow. A JSON-only add-on can reference or patch a dependency's profile and registered shape after declaring that dependency.

Compatibility and reference boundaries

The base ID lookup includes the writable registries plus read-only zones. Empty extension catalogs are expected before mods load. Generated packed resources and recipes are published through RegistryAccess after runtime initialization.

The field snapshot excludes forbidden identity/display-text fields and records the currently available top-level values fields. Some legacy nested parsers still ignore unknown keys; use these documented names rather than treating successful parsing as proof a new field exists. Runtime registry validation is the final check for the installed game version.

Difficulty and wildlife migration

The difficulty registry patches the existing EASY, NORMAL, HARD, and NIGHTMARE IDs in difficulty_settings.json. Its values sections are worldResources, settlement, wildlife, creatureLevels, creatureGrowth, and startingForces. It supports patch only.

creatureRespawns exposes profiles in creature_respawns.json, including participantDefinitionIds, birth, migration, campMigration, and balance. It supports add and patch; the existing creature registry supplies participants. Neither registry requires a display-name translation.

See difficulty authoring for fields, bounds, calendar semantics, the default balance and a complete mod patch example.

Crafting categories and packed goods

These five JSON registries require Content API 15. The base game now ships Settlement Trading's category, 63 packed products, 126 generated recipes, packing table, pallet, artwork and translations. The source study preserves the original mod-owned design. Additional products and independent packing profiles still use these public registries.

Registry Required fields and behavior
disciplines A visible additional top-level category supplies menuIconPath (a mod-owned PNG), menuOrder (0–1024) and laborType (an existing crafting labor ID). Optional menuSubtitleKey is localized. Categories follow the built-in rows, sorted by order then ID. New disciplines normally omit professions; this does not add citizen profession enum values. Names use crafting.discipline.<id>.
packingProfiles crateResourceId, labelResourceId, stockpileZoneId, disciplineId, workstationId, nameKey, packNameKey, unpackNameKey, premiumPercent (0–1000), workTicks and unpackTicks (positive). The container is returned on unpacking; label and dye are consumed. Name arguments are product and quantity; recipe-name arguments are the packed-resource name.
tradeGoods resourceId, amount (1–1000), profileId, category, dyeResourceId, color (#RRGGBB), and preservation (1–8). The entry ID becomes the packed resource. For pack_id:good, generated recipes are pack_id:pack_good and pack_id:unpack_good. Adopted unnamespaced IDs retain pack_<id> and unpack_<id>. Inputs and outputs are exact, unaffected by profession bonuses; food age is carried through packing and unpacking. One packing definition per contained resource; recursive packing and generated-ID collisions are rejected.
storageGroups A named storage classification for resources and placeable storage, without adding a paintable zone. Names use stockpiles.<id>. IDs cannot collide with zones.
storageDisplays placeableId, foregroundPath (PNG), scale (greater than 0, at most 8), anchorX, anchorY, foregroundAnchorX, foregroundAnchorY, offsets (1–32 [x,y] pairs), layerHeight (nonnegative), and maxItems (1–128). Pixel coordinates are finite and bounded to ±4096. Packed cargo uses these slots in repeated layers. Stock changes refresh only the affected storage overlay.

All registries use ordinary namespaced add/patch operations, dependency checks, captured assets and full translation validation. The field index gives exact accepted keys. Copying a sample or publishing a derivative pack remains supported.

ModContext.registerTradeFilter(Predicate<String>) registers one filter per pack for both directions of merchant and settlement trade. All active filters must accept a resource. Native Settlement Trading accepts registered tradeGoods definitions, including additions from mods. A dependent mod can add its own packing definition and join the catalog without editing the engine. All additional filters combine with the native packed-goods-only restriction.

Packing disciplines display Pack and Unpack tabs. Pack is selected initially. Unpack lists owned crates, including deliveries at the banner, and retains queued unpacking orders so they can still be cancelled after stock runs out. Opening owned cargo does not require discovering how to manufacture its contents; the configured workstation is still required.

ModContext.registerManualTradeReservations(boolean) controls the optional reservation workflow. Native Settlement Trading registers false, hiding the Stock reservation tab and preventing new reservations. Existing reserved cargo returns to its owning settlement at the banner through durable receipts when that town is opened, preserving metadata and preventing duplicate returns after loading an older save. The reservation API remains available for compatibility; a mod cannot override a provider's opt-out.

Existing unnamespaced content moving out of the base game may declare exact IDs in the manifest's legacyIds array. This is an explicit save-identity migration, not a way to overwrite base content: existing-ID collisions are still errors, references require the owning dependency, and adopted translation keys must match the registry and exact ID. New content should use namespaced IDs. Native Settlement Trading retains the original packing identities so saves keep their resource, recipe, category and placeable references.

Gameplay registries

All six registries below require contentApi: 3. They support add, copyFrom and patch, with the same dependency rules, object merging and array replacement as other registries. The Meadow Life project connects them to actual game systems. The machine-readable contract lists every accepted top-level field, nested path, type and constrained choice. Unknown nested keys and wrong types are rejected. Integers must fit a signed 32-bit value; numbers must be finite.

Families

Name key: resource_families.your_mod:local_id. A family's identity is its operation id.

Field Type Meaning
displayResourceId Optional resource ID Icon representing the family
resourceIds Array of resource IDs Explicit members; references must exist
resourceIdPrefixes Array of strings Additional members whose IDs start with these prefixes
resourceUnitValues Object mapping resource IDs to positive integers Contribution of one item to a family ingredient; omitted members contribute one

Use familyId in a recipe ingredient. Prefixes are selectors, not resource definitions. A prefix from another mod's namespace requires that dependency. The Java snapshot exposes these authored selectors; it does not expand prefix membership into a list for you.

Food

The operation id is the resource ID. Do not put resourceId or resourceIds in values. Adding a food profile requires an existing or newly added resource with that same identity. The resource can belong to the base game; another mod's resource requires that dependency. Grouped base profiles are expanded before composition: patching one resource never changes siblings. Food profiles also apply to inventory resources generated by craftedResource placeables. Their nutrition and food valuation take precedence over resource metadata, just as for ordinary resources. Overrides of the same food field by separate packs require an explicit dependency; changing another member of a grouped base profile does not conflict.

Field Type / behavior Meaning
nutrition Integer; negative values normalize to zero Hunger restored; positive values make the resource edible
happiness Integer, normalized to −500…500 Happiness adjustment after consumption
shelfLifeDays Integer, minimum one Normal loose-stack shelf life
heatedShelfLifeDays Integer; nonpositive falls back to normal shelf life Shelf life in heat
quality ingredient, raw, preserved, basic, standard, fine, luxury Authored food tier
tradeValue Nonnegative integer; zero derives value Optional explicit food valuation
providesWater Boolean Supplies the fresh-water meal bonus
effects Array of effect objects Existing immediate or temporary effects

Effects accept type, numeric magnitude, and integer durationInGameMinutes. Types are MOVEMENT_SPEED, HEALTH_REGENERATION, HEALTH_RESTORE, and REST_RESTORE. Food inherits its resource's localized name. Storage placement still belongs to the resource definition.

Equipment

The operation id is the resource ID. Add the resource and a way to produce it separately. You may also add a missing equipment profile to a base or declared dependency's resource. Equipment uses the resource's localized name.

Fields Type / purpose
slot Existing slot: armor, weapon, helmet, accessory, mount, cloak, horse_armor
damage, armor, maxHp, movementSpeed, spellPower Numeric base modifiers; fractional values are preserved
healthPercent, armorPercent, armorPenetrationPercent, hitChance, dodgeChance, blockChance, critChance, critDamagePercent, terrorChancePercent Numeric modifiers interpreted by the existing combat system
attackAccuracyMultiplier, attackKnockbackChance, attackDodgeChanceBonus, elementalBonusIntScaling Numeric attack modifiers
attackCooldownTicks Integer attack cooldown override
attackPattern, attackVariant, damageElement Existing serialized combat choices; copy a compatible base weapon
attackEffects Existing on-hit effects with type, chance, durationTicks, magnitudePercent, intScaling, tickIntervalTicks, maxStacks
glow Optional object: registered essence key and boolean offhandUsesWeapon

Slot behavior is still engine-owned. In particular, the existing accessory convention distinguishes shields by shield in the base resource ID; other accessories behave as cloaks. Mounts have their own consumers. Adding a slot string does not add a UI slot. Glow requires an eligible weapon/shield; offhandUsesWeapon is weapon-only. This registry adds stats and existing effects, not arbitrary code executed on an attack or a new combat formula.

World features

Registry name: features; name key: world_features.your_mod:local_id. Copy a suitable existing plant or object, then override its art, interaction flags and drop profile. Common fields:

Fields Purpose
footprintWidth, footprintDepth, heightBlocks, occlusionHeightBlocks Integer geometry and occlusion
gatherable, harvestable, woodcuttable, diggable, movable Existing interaction capabilities
fruitBearing, stumpRegrows, seasonallyDormant, removesOnGather, removesOnHarvest Existing growth and removal behavior
moveResourceId Optional resource yielded when moving a feature
spritePaths, depletedSpritePaths, seasonalSpritePaths, deadSpritePaths, stumpSpritePaths Arrays of PNG paths or supported sprite-sheet cell keys
dormantSpritePath, depletedSpritePath, stumpSpritePath, deadSpritePath Single state artwork
variantCount, seasonalVariantCounts, growthStageVariantCounts, dailyGrowthMax, growthYieldByLevel Integer variation/growth settings
renderScale, anchorOffsetYTiles, shadow Rendering placement; shadow accepts enabled, widthScale, heightScale, offsetX, offsetY, shearX, alpha
dropProfile Resource selectors, amount ranges and additional random outputs
decorationValue, decorationRadius, decoration Existing decoration effects, including living, stump and dead states

dropProfile can specify primaryResourceId/primaryMin/primaryMax, gatherResourceId/gatherMin/gatherMax, and rareResourceId/rareChancePercent/rareMin/rareMax. Its randomOutputs objects accept resourceId, chancePercent, minAmount and maxAmount. Additional feature settings:

Field Meaning / fallback
animated Enables the existing two-seasonal-frame animation behavior; does not register a new animation system
blocksFullTileUse Prevents actors/structures using the tile; fallback false; tree rules can still block it
understory Low vegetation may share a support tile with a tree; cannot also be a tree or full-tile blocker
canDie Defaults to true. When false, generation and gameplay cannot mark the feature dead, and saved dead flags load as living. Stumps keep their separate state and decoration effect.
harvestApproach DEFAULT allows ordinary adjacent approaches; DRY_CARDINAL_SHORE uses a cardinal dry shore tile
submergedInWater Existing submerged rendering flag; fallback false
decoration.living, decoration.stump, decoration.dead State-specific objects: integer value and tile radius default to zero; overlapGroup defaults to the definition ID plus state

Legacy dropProfile yield fields use the existing feature-work rules:

Fields Meaning
leavesMin, leavesMax Leaf amount bounds
sticksMin, sticksMax Stick amount bounds
rareEggsMin, rareEggsMax Egg amount bounds for the existing 10% roll
jackpotEggsMin, jackpotEggsMax Egg amount bounds for the existing 1% jackpot roll
feathersMin, feathersMax Feather amount bounds when eggs drop
stumpRoots, stumpWood Minimum roots/wood when clearing a stump with Woodcutting

These yield fields default to zero when not inherited. Use randomOutputs for explicit additional resource rolls. The feature animationFrames array and filename-pattern fields are not exposed for direct mod edits, even though copied base definitions may contain them.

A sheet cell uses sheet:assets/mods/your_mod/plants.png#column,row,size, with nonnegative cell indices and a positive pixel size. The complete square must fit the source image. Normal PNG paths also work. This API deliberately exposes explicit paths, not every internal filename-pattern option.

The feature registry does not expose the document's world-generation distribution rules. Give a feature a placement route, such as placeables.plantedWorldFeatureId; the sample demonstrates this.

Creatures

Name key: creatures.your_mod:local_id. Copy a suitable creature to preserve complete visuals and behavior. This registry exposes authored definitions, not an implementation API for new AI.

Fields / group Purpose
bodyType, controlMode, disposition, role, tags Existing actor classification and selectors
visuals Existing walk/attack/death and special-action sprite paths, frame counts, banks and render scale
combat Level range, attack cadence, accuracy, existing effects/patterns, ranged settings and supported special actions
movementPerTick, movementProfile, wanderRadius Existing movement behavior
spawnCount, spawnCountRandomMin, spawnCountRandomMax, spawnCountNormalBonus, spawnCountLargeBonus Initial population settings
spawnBiomes, spawnSurfaceTypes, spawnMinDepthBelowSurface, spawnMaxDepthBelowSurface Placement selectors
herdFamilyId, herdCompositions and the supported herd* counts Group ownership and initial herd composition
tamingFoodIds Resource IDs accepted by existing taming behavior

Read the creature field explanations for individual settings and defaults, and the generated index for exact accepted paths. For example combat.level and combat.maximumLevel are integers, while combat.meleeDamageMultiplier is a number. The legacy root spawn object is not supported; use the root spawnCount* fields above. Adding a spawn object would not configure the engine's spawn reader.

Creature artwork uses the engine's existing directional animation contract; see the asset guide. A new definition does not create a new profession, unit archetype, animation state or sound registry. Use creatureRespawns to connect births and later migration. A creature may belong to only one respawn profile.

Creature loot

Registry name: creatureLoot. A rule's operation id is namespaced and needs no display name.

Object Accepted fields
match String arrays: creatureIds, creatureIdPrefixes, campaignActorIds, campaignActorIdPrefixes, bodyTypes, tagsAny, tagsAll, excludedTagsAny
Each drops entry resourceId, resourceOptions, resourceOptionsFrom, numeric chancePercent, integer minAmount and maxAmount

Use a fixed resourceId or existing random-option mechanism. __colony_gold is the special currency ID for fixed loot entries. A rule must use real resources/creatures; tags and prefixes are selectors. Existing dynamic resourceOptionsFrom values are validated by the runtime.

Every matching rule contributes its drops; rules do not stop at the first match. Normal essence and gold systems can contribute separately. Copying an animal's tags may therefore inherit broad base loot rules as well as your specific rule. These are definition-driven death drops, not a general death-event callback or an API for hardcoded carcass interactions.