Wiki ArticleJava EditionGenerated features

Random Selector

Random selector is a technical feature that randomly chooses a feature from a list with chances.

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.

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 typeIdentifier
[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).

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.