Random selector
This article is about the terrain generation feature. For the target selector
@r, see Target selectors.This feature is exclusive to Java Edition.
Random selector is a technical feature that randomly chooses a feature from a list with chances.
Data values
ID
| Feature type | Identifier |
|---|---|
| [No displayed name] | random_selector |
Config
Main article: Configured feature
- [NBT Compound / JSON Object] config
- [String][NBT Compound / JSON Object] default: One placed feature (an [String] ID, or a new [NBT Compound / JSON Object] placed feature definition) — Used if none of the below features are chosen.
- [NBT List / JSON Array] features: (Required, but can be empty) A list of placed features from which to randomly choose.
- [NBT Compound / JSON Object]: A feature and its corresponding chance.
- [String][NBT Compound / JSON Object] feature: One placed feature (an [String] ID, or a new [NBT Compound / JSON Object] placed feature definition)
- [Float] chance: The chance of this feature being chosen. Value between 0.0 and 1.0 (inclusive).
- [NBT Compound / JSON Object]: A feature and its corresponding chance.
The defined features can either reference a placed feature directly, or can reference a configured feature by nesting another "feature" node within. For more information, see this page on the two allowed types of feature definitions.
An example
{
"type": "minecraft:random_selector",
"config": {
"default": {
"feature": "minecraft:patch_grass_jungle",
"placement": []
},
"features": [
{
"chance": 0.05,
"feature": "minecraft:fancy_oak_checked"
},
{
"chance": 0.15,
"feature": "minecraft:jungle_bush"
},
{
"chance": 0.7,
"feature": "minecraft:mega_jungle_tree_checked"
}
]
}
}
| |||||||||||||||||||||||||||
| |||||||||||||||||||||||||||