De technische documentatie is beschikbaar in het Engels. Code en veldnamen volgen de huidige Mod API.
MODDINGDOCUMENTATIE
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
- Use equipment fields for combat stats.
- Use resource fields for the inventory icon and storage.
- Use recipe fields for ingredients, stations, and output.
- Check exact accepted spellings in the field index.
- 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_spearrecipes.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
- Choose Refresh → Enable → Apply & reload in Mods.
- Open a test world and unlock the ordinary Stone Spear recipe requirements.
- Find Craft Practice Spear, provide its ingredients, and craft it.
- Inspect its name, icon, and equipment stats. Check equipment use on a compatible unit.
- Reload after each file edit.
