FORGOTTEN TOWNS

FORGOTTEN TOWNS / МОДИНГОВАЯ ДОКУМЕНТАЦИЯ

Моддинг вики ↗

Java Ссылка на API (Javadoc)

MOD API 15

Просмотрите вики

Текущая документация API модов.

Техническая документация доступна на английском языке. Имена кода и полей соответствуют текущему Mod API.

МОДИНГОВАЯ ДОКУМЕНТАЦИЯ

Add a weapon with JSON

Result: a craftable Practice Spear with equipment damage 3. It reuses the Stone Spear's icon and existing equipment behavior. No Java is required.

1. Copy the starter

Copy content_starter to the mods folder. To keep only this example, set mod.json's patches to ["data/weapon.json"]. You may then set requiresNewWorld to false.

2. Read the three definitions

Open data/weapon.json.

Operation Why it is needed Change this
Add resources.content_starter:practice_spear, copied from stone_spear Inventory item, storage category, and icon tradeValue, or the supported icon fields
Add equipment.content_starter:practice_spear, copied from stone_spear Makes the same resource a weapon with stats damage is set to 3
Add recipe content_starter:practice_spear, copied from stone_spear_crafting Gives players a production route outputResourceId points to the new resource

The resource and equipment IDs must match. The recipe ID can differ; its output must name the resource. The copied recipe keeps its ingredients, work stages, zone, and discovery rules. Adding only a resource does not make it equipment. Adding equipment does not make it obtainable.

3. Change the fields you need

  1. Use equipment fields for combat stats.
  2. Use resource fields for the inventory icon and storage.
  3. Use recipe fields for ingredients, stations, and output.
  4. Check exact accepted spellings in the field index.
  5. Keep an existing compatible slot, attack pattern, and effect type.

damage is an equipment contribution, not a guarantee that every hit deals that final amount. The unit and combat rules still apply. A copied inventory icon does not create a new weapon animation on a character. New held-weapon artwork, weapon handling, and unit compatibility remain subject to the existing engine systems.

4. Add the names

The starter supplies these keys in every language:

  • resources.content_starter:practice_spear
  • recipes.content_starter:practice_spear

Edit the values in each catalog. Equipment uses the resource name and needs no separate label. For a new pack ID, follow the namespace and translation rules.

5. Check the result

  1. Choose Refresh → Enable → Apply & reload in Mods.
  2. Open a test world and unlock the ordinary Stone Spear recipe requirements.
  3. Find Craft Practice Spear, provide its ingredients, and craft it.
  4. Inspect its name, icon, and equipment stats. Check equipment use on a compatible unit.
  5. Reload after each file edit.

Return to JSON-only instructions.