Grass Generation

Introduction

generators.json contains a list of 'Generator' which generates grass in the world periodically.

Grammar

generators.json
[
  biome_and_generator,
  biome_and_generator,
  ...
]
biome_and_generator
{
  "types" : [biome_type, ...],
  "generator" : generator
}
|
{
  "biome" : string,
  "generator" : generator
}
|
{
  "generator" : generator
}
biome_type
"HOT" |
"COLD" |
"SPARSE" |
"DENSE" |
"WET" |
"DRY" |
"SAVANNA" |
"CONIFEROUS" |
"JUNGLE" |
"SPOOKY" |
"DEAD" |
"LUSH" |
"NETHER" |
"END" |
"MUSHROOM" |
"MAGICAL" |
"RARE" |
"OCEAN" |
"RIVER" |
"WATER" |
"MESA" |
"FOREST" |
"PLAINS" |
"MOUNTAIN" |
"HILLS" |
"SWAMP" |
"SANDY" |
"SNOWY" |
"WASTELAND" |
"BEACH" |
"VOID"
generator
{
  "condition" : condition,
  "grass" : block_state | [block_state, ...]
}
condition
{
  "below" : block_state | [block_state, ...],
  "chance" : double,
  "not_adjacent" : block_state | [block_state, ...]
}

For block state, follow this page

Usage

There are 3 variants of biome_and_generator. First variant which has "types" field, applies corresponding generator to every biome wihch has all "types". Second variant which has "biome" field, applies corresponding generator to the "biome" only. Last one applies the generator to every biome without any other generator. In other words, this is a default generator.

generator has two fields "condition" and "grass". When "condition" meets, generates "grass". "grass" can be a single block_state or a list of block_states. When "grass" is given as a list, one block_state is randomly selected and generated.

condition has three fields, and each field can be ommited. Each field represents a condition, and every field must be satisfied. Ommited field is simply considered satisfied. "below" is met when block below target position is one of listed block_state."chance" is met purely by chance. "1.0" means always, "0.0"means never. Using this field you can specify speed or frequency of grass growth. "not_adjacent" is met when there's no block_state listed nearby target position (8 blocks).

Examples

{
    "biome" : "minecraft:jungle",
    "generator" : {
        "condition" : {
            "below" : {"name" : "minecraft:grass"},
            "chance" : 0.25,
            "not_adjacent" : {
                "name": "minecraft:tallgrass",
                "type": "fern"
            }
        },
        "grass" : {
            "name": "minecraft:tallgrass",
            "type": "fern"
        }
    }
}

Grass grows rapidly in jungle.

{
    "biome" : "minecraft:plains",
    "generator" : {
        "condition" : {
            "below" : {"name" : "minecraft:grass"},
            "chance" : 0.1,
            "not_adjacent" : {"name": "minecraft:yellow_flower"}
        },
        "grass" : {
            "name": "minecraft:yellow_flower",
            "type": "dandelion"
        }
    }
}

Dandelion is growing in plains.

{
    "types" : ["COLD", "MOUNTAIN"],
    "generator" : {
        "condition" : {
            "below" : {"name" : "minecraft:grass"},
            "chance" : 0.05,
            "not_adjacent" : {"name": "minecraft:tallgrass"}
        },
        "grass" : {
            "name": "minecraft:tallgrass",
            "type": "fern"
        }
    }
}

Grass grows very slowly in every "COLD" "MOUNTAIN".

Last updated