FORGOTTEN TOWNS

FORGOTTEN TOWNS / DOKUMENTACJA MODDOWANIA

Wiki o modowaniu ↗

Java Odniesienie do API (Javadoc)

MOD API 15

Przeglądaj wiki

Aktualna dokumentacja Mod API.

Dokumentacja techniczna dostępna jest w języku angielskim. Nazwy kodów i pól są zgodne z bieżącym API Mod.

DOKUMENTACJA MODDOWANIA

Connect your content to gameplay

Content API 15 also exposes crafting categories and packed goods. The Settlement Trading source study preserves a complete example of a parent pack owning content and art. Its gameplay is now native; third-party packs use the same reusable packing, menu, storage-display and trade-filter behavior.

Use these registries to connect items to eating, equipment, harvesting, and creature drops. These definitions can all be authored without Java. Start with the weapon, furniture, or creature instructions. The Meadow Life project is a larger connected example with an optional Java consistency callback.

Registry Identity What to connect
families Namespaced family ID Recipe ingredients to a group of resources
food Resource ID A resource to eating, happiness, spoilage and existing food effects
equipment Resource ID A resource to base equipment stats and existing attack effects
features Namespaced feature ID A plant or other world object to art, harvesting and drops
creatures Namespaced creature ID An actor definition to existing movement, combat, art and spawning
creatureLoot Namespaced rule ID Creature selectors to resource drops

Example: edible berries

[
  {"registry":"resources","op":"add","id":"my_mod:berry",
   "copyFrom":"blueberry","values":{"tradeValue":2}},
  {"registry":"food","op":"add","id":"my_mod:berry",
   "copyFrom":"blueberry","values":{"nutrition":120,"happiness":1}}
]

Declare contentApi: 3, list this patch in the manifest, and supply resources.my_mod:berry in all thirteen translation catalogs. Food takes its displayed name from the resource, so it needs no separate name. For the installable project use Meadow Life; this snippet only explains the two linked definitions.

Adding food data does not produce the item. Add a recipe, a feature's drop profile or a loot rule. The sample does all three. Food IDs address individual resources even when the base file groups several resources in one profile; patching a blueberry leaves redberries unchanged.

Use the existing systems

  • A family supplies resourceIds and/or resourceIdPrefixes; a recipe consumes it with familyId. Arrays replace whole arrays, so preserve members when intentionally extending a base family.
  • Equipment requires a resource with the same ID and a supported slot. Stats alone do not supply a recipe or weapon artwork. Fractional statistics are supported.
  • A feature needs a placement route. A placeable's plantedWorldFeatureId can create it through ordinary planting. World-generation distribution rules are not an exposed registry.
  • A creature definition uses existing AI and combat behavior. Add spawn settings or a separate creatureRespawns profile; defining it alone is not a guarantee it will appear in every world.
  • Loot rules can match the creature's ID, body type or tags. Every matching rule contributes; adding a specific rule does not cancel a broader base rule.

Names for new families use resource_families.full_id; features use world_features.full_id; creatures use creatures.full_id. Equipment and food use their resource names. Loot and respawn rules have no player-facing name. Namespaced IDs stay stable across saves.

Query the final result

A Java mod can register onRegistriesReady to look up immutable authored definitions after all packs compose. This can check dependencies or prepare its own lookup tables. It cannot mutate registries or live game objects. See Java extensions for a compilable project and lifecycle.

Use the JSON reference for supported fields and the SDK's field contract for exact nested spellings and types. Unknown fields in these six registries are rejected, including nested typos.