Actually, mapgen and items are handled differently.
You’re looking for editing item groups. So, quick rundown.
Basically, Items exist. Those items are organized into things called itemgroups. You can see itemgroups in your Cataclysm directory/data/json. There’s a folder called itemgroups and a json file called item_groups.
This is how items are organized. Items can exist in multiple itemgroups. The “id” is the name of a given group.
Now when items are spawned in locations, they’re spawned (typically, maybe always?) in that location’s .json file. IE:
"place_loot": [
{ "group": "butcher_meat", "chance": 80, "x": [ 4, 4 ], "y": [ 3, 3 ] },
That’s from the Butcher shop. It will spawn an item from the group butcher_meat at those particular coordinates with a chance of 80 (which I think is just a flat percentage chance to spawn.)
Items spawned on creatures are spawned on their death, following a similar theme. Most creatures have “death_drops” which is basically just an item group that contains all possible objects a creature might drop.
So, if you’re still with me, that’s a very, very broad overview of how items are handled. Now, as of about a month ago, there was no way to override existing itemgroups. IE: You can’t go to that butcher_meat group and overwrite it with new entries. You can, however, add things to that list.
How to create a mod file to edit itemgroups: Ugh. Look at other mods. Create a new folder in your mod directory. Copy/paste modinfo.json from another mod into the new folder. Edit the modinfo file in a text editor and give it its own name, Ident, and author. Create a new .json file in the moddirectory. Edit the .json by copy-pasting itemgroups from the core game files and add things to it. You’ll have to look up item names and things like that.
God, typing it out is super tedious and sounds confusing. If you have questions, create a new thread (this one is about mapgen stuff) and ask them. It’s mostly intuitive but we can talk you through things if you get stuck.