Skip to content

Worldgen Block Supplier

Archengius edited this page Jun 22, 2018 · 4 revisions

#Block Suppliers While Fillter determines location of blocks relative to vein's center, actual content of veins are determined by block suppliers. They decide, which block to place, basing on block being replaced, or randomly selecting one.

Block Supplier definition can be string, in which case allowed values are: #String Definitions of Block Supplier

  • block:block_name - supplies block with given block_name (string id, example: minecraft:glass). Default state of specified block is used (i.e without any metadata). For example, for stone block, it will supply default stone.
  • ore:material or small_ore:material - supplies normal or small gregtech ore for specified material (example: titanium. Specified material is material name of any dust material gregtech defines. Supplied ore will have stone type determined via block that was replaced, i.e ore that was generated in granite will have granite as background.
  • ore_dict:ore_dictionary_tag - supplies first block that matches given ore dictionary tag "ore_dictionary_tag". It's state that was registered in ore dictionary will be used.
  • fluid:fluid_name - supplies still fluid block of fluid with name fluid_name.

Block Supplier definition can be object, in which case allowed values are:

#Object Definitions of Block Supplier (Complex Suppliers):

##Block State Supplier This supplier allows you to describe blockstate of given block with all of it's properties values. Attributes required:

  • block - specifies block id of this block state (example: minecraft:stone)
  • other properties defined in block's block state in format "attribute name": "attribute value". Examples:
{
   "block": "minecraft:stone",
   "variant": "andesite"
}
{
    "block": "minecraft:grass",
    "snowy": "true"
}

##Random Supplier ("type": "random") Supplies block randomly selected from array of specified blocks. Required attributes:

  • values - array of other block state suppliers, which will be selected randomly. Supports complex suppliers, so can be recursive if desired. Example:
{
    "type": "random",
    "values": [
        "ore:titanium",
        {
            "block": "gregtech:granite",
            "variant": "black_granite"
        }
    ]
}

##Weight Random Supplier ("type": "weight_random") Supplies block randomly selected from array of specified blocks and their weights. Required Attributes:

  • values - specifies array ob objects, each containing two properties: "weight" and "value". "weight" property defines weight of this value between other values, "value" defines block state supplier itself. Example:
{
    "type": "weight_random",
    "values": [
        {
            "weight": 50,
            "value": "block:minecraft:grass"
        },
        {
            "weight": 100,
            "value": "block:minecraft:netherrack"
        }
    ]
}

##Stone Type Match ("type": "stone_type_match") Allows to supply different block basing on stone type of block being replaced. Required Attributes:

  • default (optional) - fallback case if block being replaced didn't match any stone type specified. By default, it is air block default state.
  • unlimited number of stone types and block suppliers. Stone type is key, block supplier is value. Example:
{
    "type": "stone_type_match",
    "granite": "block:minecraft:diamond_block",
    "default": "block:minecraft:stone"
}

##Block State Match ("type": "state_match") Allows to supply different block basing in block state of block being replaced. For more information about block state filters, see page about them. Required Attributes:

  • default (optional) - fallback case if block being replaced didn't match any block state filer specified. By default, it is air block default state.
  • unlimited number of block state filters and block supplier. Block State Filter is key, block supplier is value. Example:
{
    "type": "state_match",
    "block:minecraft:dirt": "ore:stebnite",
    "default": "block:minecraft:glass"
}