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

Add a creature with JSON

Result: a level-2 Meadow Cat using the Mountain Lion's artwork and existing behavior. The pack requests two initial spawns on valid Meadows grass/dirt. No Java is required.

This adds a creature definition. It does not add a recruitable profession or unit archetype.

1. Copy the starter

Copy content_starter to the mods folder. To keep only this example, set mod.json's patches to ["data/creature.json"]. Keep requiresNewWorld: true because this example uses initial world generation.

2. Edit the definition

Open data/creature.json:

[
  {
    "registry": "creatures",
    "op": "add",
    "id": "content_starter:meadow_cat",
    "copyFrom": "mountain_lion",
    "values": {
      "spawnCount": 2,
      "spawnBiomes": ["MEADOWS"],
      "spawnSurfaceTypes": ["GRASS", "DIRT"],
      "combat": { "level": 2, "maximumLevel": 2 }
    }
  }
]

The copy keeps the lion's identity classification, disposition, movement, visuals, and tags. The two spawn arrays replace the source arrays. The combat object keeps all other copied settings. The game still needs valid spawn positions; requested counts are not a guarantee on every map.

3. Choose existing behavior and artwork

Change Fields / rule
Level range combat.level, combat.maximumLevel
Movement movementPerTick, movementProfile, wanderRadius
Animation visuals paths, frame counts, banks, and scale
Initial placement Root spawnCount*, spawnBiomes, spawnSurfaceTypes, depth fields
Herds herdFamilyId, target counts, and compositions; copying a herd animal inherits them
Existing NPC archetype unitArchetypeId; refers to an existing unit archetype, not a new one

Use the creature field explanations and exact field index. Do not add a root spawn object. Animation rows are south, south-west, west, north-west, north, north-east, east, south-east; frames run left-to-right. See the artwork guide.

4. Add later spawns or loot only if needed

  • Use creatureRespawns for births and migration. Each creature can belong to only one profile.
  • Use creatureLoot for explicit death drops. All matching rules contribute, including broad rules matching inherited tags.
  • A creature definition alone does not insert actors into an existing save.
  • Scripted scenarios can place actors through their existing scenario operations.

This sample only adds initial spawns. It deliberately retains the source's tags and behavior.

5. Name and check it

  1. Edit creatures.content_starter:meadow_cat in every translation catalog.
  2. Choose Refresh → Enable → Apply & reload in Mods.
  3. Create a new Meadows test world and explore valid surface areas.
  4. Inspect the new creature's localized name, level, movement, and combat behavior.
  5. If it is absent, check the biome, valid tiles, spawn settings, and validation log.

Return to JSON-only instructions.