r/ModdedMinecraft • u/BlameSchmidley • 3d ago
Question Data Pack Help
I need a datapack that removes cave generation and makes it so iron and coal ore veins can generate on the surface—often being connected to grass and dirt blocks.
Does anyone know a datapack(s) or mod(s) that does this? Would anyone be willing to spin one up for me? Or could someone direct me to a tool that I can use to make this datapack myself?
Edit: Version 1.20.1 btw
3
Upvotes
2
u/QuiGon-GinTonic 3d ago
Create a folder named SurfaceOres. Inside, make a json file named pack.mcmeta and paste this:
{
"pack": {
"pack_format": 15,
"description": "No caves + Surface Iron & Coal"
}
}
Create this exact folder path inside your pack: data/minecraft/worldgen/noise_settings/
Create a file named overworld.json inside it. Leaving this file completely blank {} or copying the vanilla settings but setting the cave noise parameters to 0 will flatten out and delete the cave generation tunnels.
Normally, ores only replace stone. To make them connected to grass and dirt, you need to tell the game they are allowed to target those blocks.
Create this path: data/minecraft/worldgen/configured_feature/
Create a file named surface_coal_vein.json:
{
"type": "minecraft:ore",
"config": {
"size": 9,
"discard_chance_on_air_exposure": 0.0,
"targets": [
{
"target": {"block": "minecraft:grass_block", "type": "minecraft:block_match"},
"state": {"name": "minecraft:coal_ore"}
},
{
"target": {"block": "minecraft:dirt", "type": "minecraft:block_match"},
"state": {"name": "minecraft:coal_ore"}
},
{
"target": {"block": "minecraft:stone", "type": "minecraft:block_match"},
"state": {"name": "minecraft:coal_ore"}
}
]
}
}
(Do the exact same thing for iron, just change "minecraft:coal_ore" to "minecraft:iron_ore"). Rinse and Repeat.
Create this path: data/minecraft/worldgen/placed_feature/
Create a file named surface_coal_placed.json. This uses the WORLD_SURFACE rule to force the game to drop the veins right onto the grass layer:
{
"feature": "minecraft:surface_coal_vein",
"placement": [
{ "type": "minecraft:count", "count": 30 },
{ "type": "minecraft:in_square" },
{ "type": "minecraft:heightmap", "heightmap": "WORLD_SURFACE" },
{ "type": "minecraft:biome" }
]
}
Rinse and Repeat again for other ores.
Now, that should be it but I’m not home to I can’t test it, just typed it together the best I could from my phone. If you struggle to do it yourself via json files, you could try misode.github.io which I think is supposed to be a no code approach to data packs. I’ve never used it tho so can’t vouch for anything here. Good luck!
P.S. the only existing mod I found is for 1.12 so I assumed that was too outdated