Skip to content

Ore generation

CD4017BE edited this page Feb 16, 2019 · 4 revisions

You can add custom ore generation for individual dimensions in the INIT() section of the config script. The general syntax is: add("oregen", <dimId>, <targetBlock>, <veinsPerChunk>, <blocksPerVein>, <oreBlock>, <mode>, <heights>);

  • <dimId>: the numerical id of the dimension to generate in.
  • <targetBlock>: a string or Array [] of strings specifying wich blocks to replace.
    For example ["minecraft:stone", "minecraft:netherrack"] would generate ore in both stone and netherrack. The following formats are possible:
    • "modId:blockId" represents all block state variants of a block
    • "modId:blockId@meta" represents a single block state
    • "ore:oreDictName" represents all blocks registered under the OreDictionary entry oreDictName.
  • <veinsPerChunk>: the number of ore veins to generate per chunk which may be a fractional number. For example 2.2 veins per chunk means 80% of the chunks have 2 veins and 20% of the chunks have 3 veins.
  • <blocksPerVein>: the maximum number of ore blocks per vein (must be an integer).
  • <oreBlock>: is a string representing the block to generate in each vein. For example "minecraft:iron_ore" would generate iron ore veins.
  • <mode>: the height distribution mode which may be one of
    • "even" spreads ore veins evenly between minY and maxY.
      <heights>= [minY, maxY]#
    • "center" spreads ore veins between minY and maxY with (~ 2x) higher density towards mainY.
      <heights>= [minY, mainY, maxY]#
    • "gauss" spreads ore veins with a Gaussian distribution centered around mainY with standard deviation devY.
      <heights>= [mainY, devY]#

Removing existing ore generation

The vanilla ore generation can be disabled for individual ores by setting the corresponding disable_ore variable to true.
This affects Overworld and Nether ore generation.

Modded ore generation can only be disabled via the respective mod's config if it provides such an option (usually they do).

Some examples:

disable_iron = true;
!disable vanilla iron ore generation in the overworld

...

INIT() {
    add("oregen", 0, "minecraft:stone", 10, 8, "minecraft:iron_ore", "gauss", [32, 28]#);
    !instead generate iron ore in the overworld with a Gaussian distribution centered around height 32 with a standard deviation of 28 blocks up and down.

    add("oregen", -1, ["minecraft:netherrack", "minecraft:lava"], 0.2, 25, "minecraft:glowstone", "even", [28, 36]#);
    !add some additional glowstone in the nether that spawns in huge but very rare veins near the surface of the lava lake at the bottom (heights 28-36).
    
    ...
}

Clone this wiki locally