Conditional Overlay
- Id:
moderner_beta:conditional_overlay
- Inputs:
parent
- Uses seed: depends on supplied predicates
- Added in: 3.0.0
The Conditional Overlay layer allows for biomes matching a predicate to be replaced with a certain layer target while biomes that don't match the predicate are replaced with a different target. This layer is analogous to an if-else statement or a ternary expression.
Properties
predicate
- Type:
biome-predicate
- Default: required
- Description: The predicate to compare biomes to.
- Type:
onMatch
- Type:
layer-target
- Default: required
- Description: The target to apply if the predicate is satisfied.
- Type:
otherwise
- Type:
layer-target
- Default: required
- Description: The target to apply if the predicate is not satisfied.
- Type:
Example
Conditional overlay layers are used for placing mushroom islands in oceans.
json
{
"predicate": {
"terms": [
{
"biome": "minecraft:ocean",
"condition": "moderner_beta:single_match"
},
{
"requiredCount": 4,
"diagonal": true,
"condition": "moderner_beta:identical_neighbor"
},
{
"numerator": 1,
"denominator": 100,
"condition": "moderner_beta:random_chance"
}
],
"condition": "moderner_beta:all_of"
},
"onMatch": {
"type": "biome",
"value": "minecraft:mushroom_fields"
},
"otherwise": {
"type": "biome",
"value": "minecraft:the_void*null"
},
"id": "land",
"seed": 5,
"parent": "land",
"type": "moderner_beta:conditional_overlay"
}