Skip to content

Worldgen JSON Syntax

ALongStringOfNumbers edited this page Jun 30, 2021 · 19 revisions

Root config structure

Each world gen definition config consists of following parts:

  • weight - weight of this ore definition compared to other veins. The higher this value, the more this veins occurs in place of other ore veins. Completely custom, any positive integer values are allowed.

  • density - defines relation of amount of ore blocks in vein to it's total size. Ranges in (0;1] decimal. The more it is, the more ore blocks this vein contains in it's shape.

  • priority (optional) - defines generation priority of this ore vein. Veins with bigger values are generated first, if multiple veins are encouraged in grid section. Useful for granite formations.

  • min_height (optional) - defines minimum height requirement for generation of this ore vein. It will generate only if center of vein is above this value. By default, minimum height is not limited.

  • max_height (optional) - defines maximum height requirement for generation of this ore vein. It will generate only if center of vein is below this value. By default, maximum height is not limited.

  • biome_modifier (optional) - defines map of weight modifier applied to this ore weight if given biome or biome tag is encouraged. If weight value plus this modifier for biome is below or equal to zero, vein will not be generated. By default, biome doesn't affect weight of this vein. For more information, see below.

  • dimension_filter (optional) - defines filter of dimensions in which this ore vein is allowed to generate. By default, this vein will generate in all surface worlds. For more information, see below.

  • generation_predicate (optional) - defines block states which are allowed to be replaced by this vein (formally, all blocks in which this vein can generate). By default, it generates in stones blocks. For more information, see wiki page about worldgen filters.

  • surface_stone_material (optional) (deprecated) - specifies metal material name which stones will be generated on surface to indicate this vein's existence nearby. By default, stones are not generated. This method of adding surface stones is deprecated and should not be used.

  • vein_populator (optional) - The new method of specifying surface rocks or surface blocks to indicate that a vein has spawned nearby. See below for more information.

  • name (optional) - name shown on JEI Ore Generation page, long name will be cut off

  • description (optional) - description shown for selected ore on JEI Ore Generation page, long descriptions will be split to multiple lines

  • count_as_vein - If the provided vein counts as a vein for purposes of limiting the number of veins per section. This is mostly used for Oil Fluid Springs, and material blobs, such as Basalt or Marble.

  • filler - defines structure of blocks generated in this vein, their layout and types. For more information, see wiki page about worldgen fillers.

  • generator - defines shape of vein, it's minimal and maximal sizes, special generation flags. For more information, see about worldgen generators.

Vein Populator

Vein Populators are the new system of generating vein indicators or Fluid Springs

With this method, surface rocks and surface blocks can be generated to inform the player of nearby veins.

In addition, Geysers of Fluid can be generated in world.

Surface Rocks

A surface rock is a small deposit of material located on the surface above and/or nearby an existing vein in the world

The vein populator structure is as follows

  "vein_populator": {
    "type": "surface_rock",
    "material": "apatite"
  }

This will create a surface rock for the vein with the material of apatite.

Surface Blocks

Similar to a surface rock, a surface block is something that is generated to indicate a nearby vein, but instead of being a small pile of material, this vein populator generates a specified block to mark the vein.

For surface blocks, the structure is

"vein_populator": {
  "type": "surface_block",
  "block": {
    "block": "",
    "type": ""
  },
  "min_amount": ,
  "max_amount":
}

Where block in the block json object is the block name and type is the blockstate. If the blockstate is not applicable, then this line can be removed.

Min amount and max amount are used to specify the number of surface blocks that will attempt to be placed over the vein. These values are optional, and if not specified will fall back to min_amount = 0 and max_amount = 2. When specifying these values in json, they should be entered as an Integer number.

For an example of this Surface Block Structure, see this definition from FTB:Interactions, which used a flower from the Plants mod as the vein surface block

"vein_populator": {
  "type": "surface_block",
  "block": {
    "block": "plants2:cosmetic_1",
    "type": "alliaria_p"
  }
}

Fluid Springs

Fluid Springs are geysers of Fluid that generate in world for players to pump and collect.

The Structure for these features is:

"vein_populator": {
  "type": "fluid_spring",
  "chance": 0.40
}

The chance field indicates the chance for the Fluid Spring to spawn. The fluid type itself is specified later on in the filler section of the generation file.

Biome Modifiers

Biome modifiers are specified in biome_modifiers root field and aims to provide different vein weight values for different biomes or biome dictionary tags. It is advised to use biome dictionary tags for better compatibility with other biome-adding mods. List of default biome dictionary tags with their descriptions.

Biome modifier structure as follows:

"biome_modifier": {
    //specifies that entries below are map of biome name to it's weight modifier
    "type": "biome_map",
    //50 will be added to vein weight in extreme hills biome. minecraft: is optional for vanilla biomes
    //but specifies modid of biome adder for biomes from other mods.
    "minecraft:extreme_hills": 50, 
    //500 will be subtracted from vein weight in ocean. If vein weight
    //is less or equal to 500, vein will not be generated at all in ocean biome.
    "minecraft:ocean": -500  
}
"biome_modifier": {
    //specifies that entries belos are map of biome dictionary tag name to it's weight modifier.
    //Biome tags can be added both by minecraft forge or mods. Every biome has at least one tag.
    "type": "biome_dictionary"
    //100 will be added to vein weight if it's generated in biome tagges as wet.
    "WET": 100, 
    //#200 will be added if biome is tagged as river biome.
    //If it is also tagged as wet, which is true for almost all river biomes, 300 will be added to weight in total.
    "RIVER": 200
}

Dimension Filter

Dimensions filter decides in which dimensions this ore vein should generate and in which it shouldn't. Generally it is dimension whitelist, but may also act like blacklist using pattern matching. It is defined as json array of string values. Following string values are allowed:

  • "is_surface_world" - allows generation in any surface world
  • "is_nether" - allows generation in any nether world
  • "dimension_id:1" - allows generation in dimension with id "1"
    • second ':' can be specified and then this filter will act as range of ids from first to last included, in case first or last id is not provided MIN and MAX dimension id will supplied respectively
  • "name:some_world" - allows generation in dimension with name "some_world",
  • "provider_class:WorldProviderMars" - allows generation in all dimension which provider class simple name is "WorldProviderMars" (galacticraft mars)
  • "name:[regex] - allows generation in all dimension which names match supplied regex [regex]. All symbols after first '' is interpreted as regex definition.
  • "provider_class:[regex] - allows generation in all dimension which provider class matches supplied regex [regex]. All symbols after first '' is interpreted as regex definition.