CoFH Core: Ores and More

buggirlexpres

Relatable Gamer
Trusted User
Retired Staff
Nov 24, 2012
3,940
7,373
663
6 Feet Under
twitter.com
Before you read this, I'm expecting you to have read the CoFH World Generation Users Manual. This guide isn't meant to be a replacement for it - although I will be going over the basics of Ore Generation here, it won't go nearly as in depth of the mechanics of basic ore generation as @unknown zombie did.

However, we will instead be covering some of the more recent additions to the CoFH Core user's arsenal. These various templates and generators allow for a whole new realm of generation of... well, whatever we want.

CoFHCore places its ore generation files inside of the "minecraft/config/cofh/world" folder. Here, you'll usually just find the Vanilla.json file, or if you've got Thermal Foundation installed, you'll also find the ThermalFoundation-Ores.json file.
Both of these files are JSONs. As I'm assuming you've read the required reading above, I expect you to know what at least some of the fields found in these files do. However, the fields available have changed quite a bit since then. Here, you'll find an example Vanilla.json file, with only Iron Ore enabled:
Code:
{
    "iron": {
        "template": "uniform",
        "block": "iron_ore",
        "material": "minecraft:stone",
        "clusterSize": 8,
        "numClusters": 20,
        "minHeight": 0,
        "maxHeight": 64,
        "retrogen": "true",
        "biomeRestriction": "none",
        "biomes": [],
        "dimensionRestriction": "blacklist",
        "dimensions": [
            -1,
            1
        ]
    }
}
This produces, well, your regular Iron veins:
2015-05-15_18.42.25.png
This should look fairly similar to the JSONs you saw in Unknown Zombie's guide. However, thanks to more recent additions to CoFH Core, this JSON can be re-written like this:
Code:
{
    "iron": {
        "template": {"type": "uniform", "generator": "cluster"},
        "block": "iron_ore",
        "material": "stone",
        "clusterSize": 8,
        "numClusters": 20,
        "minHeight": 0,
        "chunkChance": 1,
        "maxHeight": 64,
        "retrogen": "true",
        "biomeRestriction": "none",
        "biomes": [],
        "dimensionRestriction": "blacklist",
        "dimensions": [
            -1,
            1
        ]
    }
}
At a glance, you'll see that this new format isn't all that different then the previous, but there are two rather important things I'd like to point out.
You'll notice that under "template," instead of just stating that we want Uniform generation, we've created an Object. This Object defines two things: the type and the generator. The type should look familiar - it's just the template we defined before. The generator should seem familiar as well - it's just the clusters we've always been generating.
  • The "Type" determines the distribution of blocks when generated. Aside from the regular "uniform" template, there are also templates such as "normal," "cave," "fractal," and "surface."
  • The "Generator" determines what the groups of blocks actually appear as once generated. These generators can range from small trees, to dungeons, to geodes, and to your regular old veins.
You should also notice the new "chunkchance" variable. This variable allows you to determine the chance of the ore of generating in a chunk. The higher the number, the rarer the chance of the ore spawning.

Everything else should look almost exactly the same as the other ores you've been generating throughout the years. However, exactly the same isn't what you're here for. You want to know what these new things do, and how to manipulate them. I'm happy to provide many examples as to what you can do with these neat new toys.

When I first noticed these new possibilities for generation, I immediately singled out the Fractals and Large Veins as the things I wanted to try first. If you've ever played Phoenix Reborn, you should very well know that I'm up for crazy things when it comes to Ore Generation, so these two options naturally appealed to me.
Code:
{
    "iron": {
        "template": {"type": "fractal", "generator": "large-vein", "sparse": false},
        "block": "iron_ore",
        "material": "minecraft:stone",
        "clusterSize": 50,
        "numClusters": 120,
        "chunkChance": 350,
        "minHeight": 0,
        "veinHeight": 40,
        "veinDiameter": 48,
        "verticalDensity": 15,
        "horizontalDensity": 15,
        "retrogen": "true",
        "biomeRestriction": "none",
        "biomes": [],
        "dimensionRestriction": "blacklist",
        "dimensions": [
            -1,
            1
        ]
    }
}
When looking at this brand new JSON, one of the first things you should notice is that we've finally made the move off of Uniform generation and into Fractals. Combined with that, you'll notice that we as well modified the "cluster" generator to produce the "large-vein" generator. We've even gone as far as tacking another variable onto the end of the object.
  • The Fractal generation type creates large almost clouds of ore, called veins by its options. These veins are just general areas and parameters in which the ore can spawn. It has several sub-variables that we've added on in the rest of the JSON:
    • veinDiameter does what you would expect - it defines the maximum horizontal length of the "vein" clouds.
    • horizontal & verticalDensity determine how far apart the clouds of blocks are in the veins. This isn't actually defined in terms of blocks, so it's recommended that you experiment to find the desired result.
  • The "large-vein" generator removes the vein size limitations on the regular cluster generator. If you've ever played with CoFH Ore Generation like I have, you'll probably have notice that the cluster size of the cluster generator is limited to 32 blocks. However, once you make the move over from cluster to large-vein, you'll find that limitation removed - you'll be able to create clusters as large as you want.
    • When you use the "large-vein" generator, you'll also need to add the "sparse" boolean into the object. This essentially determines whether or not the larger veins will be more closely packed and denser or more spread out.
It's also worth noting that I upped the chunkChance - this vein will only spawn once in every 350 chunks, but, once you find it, you won't need another iron vein ever again (and yes, you can make these even bigger):
2015-05-15_18.48.56.png
Ever feel like the overworld is bland? Filled with flower after flower, without a single glimmering piece of metal in sight when you spawn? Well, you needn't worry. CoFH Core is capable of blinging up your overworld with whatever block you so choose. Keeping in theme with our previous JSONs, we'll be using Iron again for this endeavour.
Code:
{
    "iron": {
        "template": {"type": "decoration", "generator": "decoration", "genSurface": "grass", "genSky": "true", "checkStay": "false", "stackHeight": 2, "xVariance": 8, "yVariance": 4, "zVariance": 8},
        "block": "iron_ore",
        "material": "air",
        "clusterSize": 3,
        "numClusters": 20,
        "chunkChance": 1,
        "retrogen": "true",
        "biomeRestriction": "none",
        "biomes": [],
        "dimensionRestriction": "blacklist",
        "dimensions": [
            -1,
            1
        ]
    }
}
As you can probably tell, we are diving much more heavily into the editing of the beginning object. This example JSON demonstrates how we can use the Decoration type and generator to create various plants, such as our wonderful dry land, iron infused sugar cane:
2015-05-15_21.08.12.png
  • The Decoration type and generator are meant to be used and generally only work when together. They are an extension of the Surface type, which we'll get into later. The decoration type is used to generate things like flowers, sugar cane, tall grass, and basically any plant you'll end up finding on the surface. However, we're using it here to generate iron.
    • This generator adds a whole heap of things to the object - however, there's only going to be more added from here. The first, genSurface, determines which block the "plant" can spawn on. In this instance, we're having our iron spawn on top of grass, so we use grass.
    • genSky is a boolean which determines if this "plant" can generate without needing a path to the sky. If it's false, it can generate in the dark. If it's true, the plant will need a skylight in order to appear.
    • checkStay is only useful when you are actually using plants. If true, this boolean makes sure that the plant can only generate on blocks that sustain it - like sugar cane next to water.
    • stackHeight is used when you need more than one block in the tower - ex three high sugar cane or cactus. We've used it here to generate two high iron ore stacks.
    • The x, y, and zVariance determine how spread out a group of blocks can be, f'rinstance a group of three sugar cane on three adjacent blocks or two cactus several meters apart.
  • You should also note that when using this generator type, the clusterSize variable determines how many plants generate - for example the three seen in the screenshot.

Although having stacks of iron ore laying about is great, perhaps we should make it seem more natural. We could take a page out of Tinkers' Construct's book with its gravel ores. They use the "surface" type when generating their ores, which is something we'll take a look at now:
Code:
{
    "iron": {
        "template": {"type": "surface", "generator": "cluster", "followTerrain": "true"},
        "block": "iron_ore",
        "material": [
            "minecraft:stone",
            "minecraft:grass",
            "minecraft:dirt",
            "minecraft:sand",
            "minecraft:snow",
            "minecraft:water",
            "minecraft:air"
        ],
        "clusterSize": 8,
        "numClusters": 20,
        "minHeight": 0,
        "chunkChance": 1,
        "maxHeight": 80,
        "retrogen": "true",
        "biomeRestriction": "none",
        "biomes": [],
        "dimensionRestriction": "blacklist",
        "dimensions": [
            -1,
            1
        ]
    }
}
This JSON is significantly easier than the last one - especially the object. As you can see, we've returned to the cluster generator to create small veins of these ores - however, these are going to be exposed to the surface, rather than laying about underground.
  • The "surface" type is a less complex version of the decoration type. It's simply equivalent to an exposed version of the regular uniform generation.
    • It does, however, add one variable into the object, this time called "followTerrain." This variable is quite simple - if true, the clusters will be able to replace "soft" blocks - things like grass or flowers. If false, the clusters will generate around them.
But on the other hand, we've introduced something new into the equation. We now have an array instead of just one material. If you read the guide mentioned above, you should be familiar with this. This gives our ore clusters a variety of blocks that they can generate in or on. They can generate on grass or snow or water, and even air so that they can get into stacks a little ways off the ground:
2015-05-15_21.19.03.png

Another interesting style of Generation are interesting objects called "spikes." We'll once again use the "surface" type to generate these guys, but we'll switch the generator over to spikes:
Code:
{
    "iron": {
        "template": {"type": "surface", "generator": "spike", "minHeight": 7, "heightVariance": 4, "sizeVariance": 4, "positionVariance": 4, "largeSpikes": "true", "largeSpikeChance": 60, "minLargeSpikeHeightGain": 10, "largeSpikeHeightVariance": 30, "largeSpikeFillerSize": 1},
        "block": [
            {"name": "iron_ore", "weight":80},
            {"name": "gold_ore", "weight":20}
        ],
        "material": [
            "minecraft:stone",
            "minecraft:grass",
            "minecraft:dirt",
            "minecraft:sand",
            "minecraft:snow",
            "minecraft:water",
            "minecraft:air"
        ],
        "clusterSize": 1,
        "numClusters": 4,
        "minHeight": 0,
        "chunkChance": 1,
        "maxHeight": 80,
        "retrogen": "true",
        "biomeRestriction": "none",
        "biomes": [],
        "dimensionRestriction": "blacklist",
        "dimensions": [
            -1,
            1
        ]
    }
}
  • As you can tell, we're once again adding a bunch of things to the object with the "spike" generator. We'll break these down one by one:
    • minHeight determines the minimum size of the spike. Here we have 7 - so each spike is going to be at least seven blocks tall.
    • heightVariance determines the possible amount of blocks the spikes can gain. So, with out heightVariance set to 4, the spikes will be anywhere from 7 to 11 blocks tall.
    • sizeVariance is basically the same thing, except instead of adding blocks to the top of the spike, it adds it to the bottom.
    • positionVariance is a number that gives the potential offset of the spikes along the Y axis
    • largeSpikes is a boolean that determines if large spikes are possible.
    • largeSpikeChance is a number that determines the chance of large spikes spawning, if the large spikes are enabled. One in every [number] of spikes will be a large spike.
    • minLargeSpikeHeightGain is the minimum number of blocks the spikes will extend above regular spikes.
    • largeSpikeHeighVariance is the amount of blocks that can possibly be added to the minLargeSpikeHeightGain.
    • largeSpikeFillerSize determines the amount of extra layers that large spikes can have over the regular spikes.
It's also worth noting that we've changed the block being generated from just iron to a combination of iron and gold. It's basically the same as was dictated in Unknown Zombie's thread, but this time we've compressed it all into an array of objects. This means that the spikes will be 80% iron and 20% gold.
2015-05-15_21.42.42.png

We'll conclude our foray into surface generation by generating some solid metal trees. For this, we will yet again continue to use the "surface" type, but we'll instead be using the "small-tree" generator, which is the kind Minecraft uses to generate regular oak and birch trees.
Code:
{
    "iron": {
        "template": {"type": "surface", "generator": "small-tree", "genMaterial": "air", "leaves": "emerald_block", "minHeight": 5, "heightVariance": 3, "treeChecks": "false", "relaxedGrowth": "true", "waterLoving": "false", "leafVariance": "true"},
        "block": [
            {"name": "iron_ore", "weight":80},
            {"name": "gold_ore", "weight":20}
        ],
        "material": [
            "minecraft:stone",
            "minecraft:grass",
            "minecraft:dirt",
            "minecraft:sand",
            "minecraft:snow",
            "minecraft:water",
            "minecraft:air"
        ],
        "clusterSize": 1,
        "numClusters": 4,
        "minHeight": 0,
        "chunkChance": 1,
        "maxHeight": 80,
        "retrogen": "true",
        "biomeRestriction": "none",
        "biomes": [],
        "dimensionRestriction": "blacklist",
        "dimensions": [
            -1,
            1
        ]
    }
}
  • Trees are abound with the small-tree generator, and with it come many additions to the object. The trees themselves are generated similarly to regular oak and birch trees, so they won't look too out of the ordinary in minecraft.
    • genMaterial is similar to the regular material mentioned below, but it determines what blocks the leaves can replace. For this, we'll just be using air.
    • leaves should be fairly self explanatory. This field allows you to select what the leaves are made out of. We'll be going with emerald blocks here to keep the theme of green leaves.
    • minHeight decides the minimum height of the tree's trunk
    • heightVariance determines how many blocks can possibly be added to the tree's height. Birch Trees, for instance, have a higher heightVariance than the oak trees, allowing them to be higher in general, but not always.
    • treeChecks is a boolean that will prevent the trees from generating in spots where they cannot "grow," ex a low light level or too many blocks surrounding them.
    • relaxedGrowth allows the bottommost "log" of the tree to generate with blocks surrounding it, which is what allows (for example) the trees in swamps to grow with water around the bottom log.
    • waterLoving is another boolean that swamp trees use - it allows them to generate even deeper in water, and it's even possible for them to generate with all the way up to the leaves underwater.
    • leafVariance is the final boolean, and it simply allows leaf blocks to go missing from the corners of trees, giving them a more rounded look.
2015-05-15_21.50.58.png

Now that we've brightened up the surface, its time we took some steps to liven up the underground as well. We're going to be doing this by using the "stalactite" generator, coupled with the "cave" type, so that we can have stalactites appearing in the caves. Now, just for a refresher - stalactites hang down from the ceiling while the stalagmites rise up from the ground.
Code:
{
    "iron": {
        "template": {"type": "cave", "generator": "stalagtite", "genBody": "air", "minHeight": 7, "heightVariance": 4, "genSize": 0, "heightMod": 5, "sizeVariance": 2, "smooth": "false", "fat": "false"},
        "block": [
            {"name": "ThermalFoundation:Ore", "metadata": 2, "weight":80},
            {"name": "ThermalFoundation:Ore", "metadata": 3, "weight":20}
        ],
        "material": [
            "minecraft:stone",
            "minecraft:air"
        ],
        "clusterSize": 1,
        "numClusters": 4,
        "minHeight": 0,
        "chunkChance": 1,
        "maxHeight": 80,
        "retrogen": "true",
        "biomeRestriction": "none",
        "biomes": [],
        "dimensionRestriction": "blacklist",
        "dimensions": [
            -1,
            1
        ]
    }
}
2015-05-15_22.13.52.png
((I'm just going to pause here. More coming in the coming days.))
 

ThatOneSlowking

New Member
Jul 29, 2019
3,523
0
0
I'll be honest, I have a faint idea of what is going on.

But from what I saw and skimmed reading, this is prety fuc- wait, stupid, useless censors.

Hrm... Kick ass? I'll go with that.

If I ever manage to get into minecraft again and CoFH core is still around this will be fun to mess with.
 

buggirlexpres

Relatable Gamer
Trusted User
Retired Staff
Nov 24, 2012
3,940
7,373
663
6 Feet Under
twitter.com
I'll be honest, I have a faint idea of what is going on.

But from what I saw and skimmed reading, this is prety fuc- wait, stupid, useless censors.

Hrm... Kick ass? I'll go with that.

If I ever manage to get into minecraft again and CoFH core is still around this will be fun to mess with.
Yup, it's amazing. There's much more to it as well, that I didn't have the time to get into. You can make vanilla-style dungeons out of custom blocks (with custom entities), Geodes made out of whatever you want, plates, or even boulders. It's amazing how much you can do.
 

Eruantien

New Member
Jul 29, 2019
1,181
0
0
Kupos to you, my good scrub. This is awesome. :p
Yup, it's amazing. There's much more to it as well, that I didn't have the time to get into. You can make vanilla-style dungeons out of custom blocks (with custom entities), Geodes made out of whatever you want, plates, or even boulders. It's amazing how much you can do.
Will you be making a guide for these as well?
 

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,838
2,140
248
Small necro bump with a valid question.

Is it possible to generate "ores" next to specific fluid blocks? I want to experiment with "ore gen" around mod added lakes (such as poison, sludge, etc)
 

buggirlexpres

Relatable Gamer
Trusted User
Retired Staff
Nov 24, 2012
3,940
7,373
663
6 Feet Under
twitter.com
Small necro bump with a valid question.

Is it possible to generate "ores" next to specific fluid blocks? I want to experiment with "ore gen" around mod added lakes (such as poison, sludge, etc)
Yuuup
Something along the lines of:
Code:
"template": {"type": "underfluid","generator": "cluster", "genFluid": "minecraft:water"},
It might be liquid:water or whatever forge does for the liquids, but you get the base idea. You can actually avoid the whole genFluid portion of it and it'll auto-magically generate under fluids that have like the material of "water."
 

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,838
2,140
248
Yuuup
Something along the lines of:
Code:
"template": {"type": "underfluid","generator": "cluster", "genFluid": "minecraft:water"},
It might be liquid:water or whatever forge does for the liquids, but you get the base idea. You can actually avoid the whole genFluid portion of it and it'll auto-magically generate under fluids that have like the material of "water."
Hmm, so only under the liquid, not around the edges?
 

tedyhere

New Member
Jul 29, 2019
1,286
0
0
Ok @Gideonseymour I moved my issue over to here :p

I did some editing of the ore gen and I am pastebining it and the forge log with the error in it. Never mined the Template 'normal' failed to parse.. I fixed that by putting it back to uniform.

VanillaGen.json

Forge Log

I can't see the issue or I am dumb
 

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,838
2,140
248
Has anyone used the Lake generator? I've attempted, and always get a crash, so I'm derping up something:

Code:
  "LakeTest": {
  "template": {"type": "surface", "generator": "lake", "useMaterial": "false", "outlineBlock": "Mekanism:SaltBlock"},
  "block": "MineFactoryReloaded:meat.still",
  "material": [
  "minecraft:stone",
  "minecraft:grass",
  "minecraft:dirt",
  "minecraft:sand",
  "customitems:wasteland_dirt"
  ],
  "numClusters": 40,
  "minHeight": 0,
  "chunkChance": 1,
  "maxHeight": 128,
  "retrogen": "true",
  "biomeRestriction": "none",
  "biomes": [],
  "dimensionRestriction": "whitelist",
  "dimensions": [
  0
  ]
  }
Just for now test, lakes of liquid meat surrounded by Salt - tasty.
 
  • Like
Reactions: Lethosos

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,838
2,140
248
So, I thought I'd shelf the lakes for a bit, and try some decoration. Nothing. COFH world gen hates me.
Thing is, it's a basic copy of the example above, with just block IDs changed.

Code:
  "TreeTest": {
  "template": {"type": "decoration", "generator": "decoration", "genSurface": "customitems:wasteland_dirt", "genSky": "true", "checkStay": "false", "stackHeight": 5, "xVariance": 8, "yVariance": 4, "zVariance": 8},
  "block": "minecraft:lapis_block",
  "material": "air",
  "clusterSize": 3,
  "numClusters": 20,
  "chunkChance": 1,
  "retrogen": "true",
  "biomeRestriction": "none",
  "biomes": [],
  "dimensionRestriction": "whitelist",
  "dimensions": [
  0
  ]
  },
customitems:wasteland_dirt is pretty much everywhere, so I should get something, but nothing. Log says it's read the JSON fine. I'm very confused.

Plus, anything further regarding the lakes much appreciated.
 

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,838
2,140
248
So, got the lake generator working, trouble is, it generates the lakes upside down! Bit of a bug there!

Lava lakes surrounded by Emerald blocks:

Code:
  "LakeTest": {
  "template": {"type": "surface", "generator": "lake", "useMaterial": "true", "outlineBlock": "minecraft:emerald_block"},
  "block": "minecraft:lava",
  "material": [
  "minecraft:stone",
  "minecraft:grass",
  "minecraft:dirt",
  "minecraft:sand"
  ],
  "clusterSize": 10,
  "numClusters": 1,
  "minHeight": 40,
  "chunkChance": 1,
  "maxHeight": 128,
  "retrogen": "true",
  "biomeRestriction": "none",
  "biomes": [],
  "dimensionRestriction": "whitelist",
  "dimensions": [
  0
  ]
  }
 

Golrith

Over-Achiever
Trusted User
Nov 11, 2012
3,838
2,140
248
Correction to the above example by Gideon.

The Decoration generator now requires an empty material list.

Code:
{
"iron": {
"template": {"type": "decoration", "generator": "decoration", "genSurface": "grass", "genSky": "true", "checkStay": "false", "stackHeight": 2, "xVariance": 8, "yVariance": 4, "zVariance": 8},
"block": "iron_ore",
"material": [],
"clusterSize": 3,
"numClusters": 20,
"chunkChance": 1,
"retrogen": "true",
"biomeRestriction": "none",
"biomes": [],
"dimensionRestriction": "blacklist",
"dimensions": [
-1,
1
]
}
}
 

Inaeo

New Member
Jul 29, 2019
2,162
2
0
As someone with no Java/json experience, I can't express how helpful this post has been. I've been fiddling around with a pack in my limited spare time (just for a few friends on our private server), and I always liked the idea of GT5 style ore veins. After 45 or so tests without the desired affect, I stumbled onto this. My thanks. Good show.