KATA 3 OF 8 · XML LAYER
Katas 1 and 2 edited things that already existed. This one makes something new: a craftable item that did not ship with the game, with a real name and description. It is still pure XML, EAC stays on, and it is the moment modding starts to feel like creation rather than tweaking.
A new crafting material, resourceReinforcedPlank, that you craft at a workbench from wood and forged iron. It reuses a vanilla icon (custom icons are Kata 5), and it gets a proper name and tooltip through Localization. Three files working together: items.xml, recipes.xml, Localization.txt.
In your modlet's Config/items.xml, use append (Kata 2) to add a brand-new <item> under /items:
<configs>
<append xpath="/items">
<item name="resourceReinforcedPlank">
<property name="CustomIcon" value="resourceWood" /> <!-- reuse wood's icon -->
<property name="CustomIconTint" value="caa472" /> <!-- recolour it (hex) -->
<property name="Stacknumber" value="500" />
<property name="EconomicValue" value="8" />
<property name="DescriptionKey" value="resourceReinforcedPlankDesc" />
</item>
</append>
</configs>
The reliable way to author a real item is to open the game's own Data/Config/items.xml, find the closest existing item, and copy its block as your starting point - then rename it and adjust. The minimal block above is enough for a usable material; weapons, tools, and food carry many more properties (a Class, actions, buffs), and copying the nearest vanilla item is far safer than typing them from memory.
An item with no recipe can only be spawned with cheats. Add one in Config/recipes.xml by appending to /recipes:
<configs>
<append xpath="/recipes">
<recipe name="resourceReinforcedPlank" count="1" craft_area="workbench" tags="learnable">
<ingredient name="resourceWood" count="10" />
<ingredient name="resourceForgedIron" count="2" />
</recipe>
</append>
</configs>
name must match the item's name - that is how the recipe knows what it produces.count is how many you get per craft.craft_area is where it is crafted (workbench, campfire, forge, chemistryStation, or omit for the backpack crafting grid). A craft_tool attribute can require a specific tool.<ingredient> rows list inputs by item name and count.Right now the item's name in-game would just be the raw key resourceReinforcedPlank. Localization maps keys to display text. Create Config/Localization.txt - it is a CSV whose first line is the header. You only need the columns you are providing (a Key column plus a language column):
Key,english
resourceReinforcedPlank,Reinforced Plank
resourceReinforcedPlankDesc,A wooden plank reinforced with forged iron - sturdier building stock.
The item's name is looked up for its title; the DescriptionKey you set in Step 1 is looked up for the tooltip. Add more language columns (french, german, ...) to translate; copy the exact header from the game's own Localization.txt if you want to match every column.
V3.0 note: in V3.0 "Dead Hot Summer" this file is renamed Localization.csv (same CSV format, accurate name). On V2.6 and earlier it is Localization.txt. Ship the name that matches your target build - see what V3.0 changed for modders.
Mods/ReinforcedPlank/Config/{items.xml,recipes.xml,Localization.txt} + ModInfo.xml at the root.Loaded Mod and for any red XML error.name, and the Localization Key must all be the exact same string. One typo and the recipe makes nothing or the item shows its raw key.appends must succeed. A red error in one file can stop the modlet loading - check the log.resourceWood, resourceForgedIron); verify them in Data/Config/items.xml.Next: Kata 4 - Server-Side Content: Zombies & Spawns. You added an item; next you add a custom enemy and make it spawn, the server-only way that needs no client download.