Random Selector
Minecraft Wiki article. Categories: Java_Edition, Generated_features
This article is reproduced from Random Selector on the Minecraft Wiki. Mirrored from revision 3642477. It is licensed CC BY-NC-SA 3.0 by the Minecraft Wiki contributors — not under the Codex’s CC BY-SA 4.0, and it may not be used commercially. Edits belong upstream, not here.
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
- [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.
{
"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"
}
]
}
}
Navigation
Sources
- Random Selector — Minecraft Wiki, CC BY-NC-SA 3.0, revision 3642477.