FORGOTTEN TOWNS

FORGOTTEN TOWNS / 改造ドキュメント

改造ウィキ ↗

Java API リファレンス (Javadoc)

MOD API 15

ウィキを閲覧する

現在の Mod API ドキュメント。

技術文書は英語で入手できます。コード名とフィールド名は現在の Mod API に従います。

改造ドキュメント

Meadow Life: connected registries

This teaching project connects the gameplay registries with existing recipes, resources, construction and wildlife migration. It uses base artwork so you can study the data.

Build from the repository or extracted SDK root with JDK 21:

.\examples\mod-sdk\build-mod.ps1 `
  -Project .\examples\registry-mod `
  -ApiJar .\build\mod-sdk\forgotten-towns-mod-api-15.jar `
  -OutputDirectory .\meadow-life-build

Install only meadow-life-build/meadow_life. Enable it in Mods, then choose Apply & reload. For a headless check use the validation instructions.

Try the chain

  1. Start a fresh sandbox to see the added meadow hog population. The existing migration and birth systems also receive a separate profile for the new creature.
  2. The plantable meadow bush copies the loose dahlia construction option and its costs and art. Its plantedWorldFeatureId creates a blueberry-style bush that yields meadow berries.
  3. Meadow hogs can also drop berries. Food profiles make the new berries edible, with nutrition, happiness and spoilage independent of their resource icon.
  4. At a Mason Bench, prepare a trail snack using three members of the new berry family. Blueberries, redberries and meadow berries all qualify. The snack has its own food profile.
  5. Stone spears receive 2.5 base damage, demonstrating fractional equipment statistics.

The complete patch array is ordered for readability; final references are checked after all patches compose. New names are translated in every supported language.

The Java entry point registers onRegistriesReady and queries the final food and recipe definitions. It checks that dependent content is still usable after other packs patch it. It runs during validation as well as game startup, so it must not open windows, contact services or assume a loaded world. Remove the manifest's code block if you want to experiment with the JSON alone; none of the sample's simulation behavior requires Java.

The API returns immutable authored definitions, including the composed changes from all packs. It does not expose live actors, world mutation, arbitrary AI code or a general event bus.