Page last edited 1,635 days 14 hours ago
From COG Docs
Jump to: navigation, search

The Substitute algorithm replaces all blocks of one type with another. It is a "helper" algorithm - not intended for actually placing ores but rather to remove the ores placed by Minecraft and other mods so that CustomOreGen can generate them instead.

Substitute Algorithm

A Substitute replacing all stone with red wool.

The Substitute algorithm scans each chunk and replaces every "replaceable" block (usually an ore) with an "ore" block (usually smooth stone, despite the name).

Distributions are generated in the order that they appear in the config file, after the vanilla generation and (hopefully) all other mods. A substitute distribution should therefore be able to replace or remove anything placed by the vanilla terrain generator, another mod, or another distribution above it.

The <Substitute> element creates a distribution using the Substitute algorithm. The <SubstitutePreset> element creates a non-generating distribution that can be used as a source of default parameters.


The Substitute algorithm may have the following attributes:

Attribute Default Value Description
name procedurally generated A name used to identify the distribution. This is used by other distributions to inherit default parameter values, for log messages, and for debugging console commands. It is recommended (but not required) that distribution names be unique and contain no whitespace.
seed unique value based on order in config file A seed modifier for random numbers generated by this distribution. If two distributions have similar settings and the same seed, they will share the same geometry.
block stone The blockID or internal name of the block to be placed (with weight 1.0). <OreBlock> elements can be used as well, or instead, but the block attribute is often shorter and easier to read.
inherits hard-coded defaults Another Substitute distribution from which to inherit all default parameter values except the name and seed.
minHeight -2147483648 The minimum substitution height. Anything below this height will not be replaced.
maxHeight 2147483647 The maximum substitution height. Anything above this height will not be replaced.


The Substitute algorithm has no numerical settings.

Ore Blocks

<OreBlock> elements can be used to specify a mixture of ore blocks to spawn with fractional weights. The total weight of all ore blocks must be less than 1.0.


<Replaces> elements can be used to change which blocks a Substitute distribution will replace (the default is to replace nothing).


<Biome> elements can be used to customize which biomes a Substitute distribution will generate in (the default is all biomes).


<!-- A substitute distribution named "EmeraldSubstitute" -->  
<!-- It replaces all emerald ore with smooth stone in Extreme Hills and Extreme Hills Edge biomes -->  
<Substitute name='EmeraldSubstitute' block='stone'>
    <Replaces block='oreEmerald'/>
    <Biome name='Extreme Hills.*'/>