Skip to main content

Feature and feature rule reference (14/14)

This page excerpts the reference from MS Learn (MicrosoftDocs/minecraft-creator a9fd1c0, CC BY 4.0). Relative links in the original are removed.

(Source: ms-learn, creator/Reference/Content/FeaturesReference/Examples/Features/minecraft_underwater_cave_carver_feature.md)

Feature Documentation - minecraft:underwater_cave_carver_feature​

Carves a cave through the world in the current chunk, and in every chunk around the current chunk in an 8-block radial pattern. This feature will specifically target creating caves only below sea level. This feature will only work when placed specifically in the pass "pregeneration_pass".

[!Note] This item requires a format version of at least 1.20.30.

Underwater Cave Carver Feature Properties​

NameDefault ValueTypeDescription
descriptionnot setDescription item
format_versionnot setString
height_limitnot setInteger numberThe height limit where we attempt to carve.
skip_carve_chancenot setInteger numberThe chance to skip doing the carve (1 / value).
width_modifiernot setMolangHow many blocks to increase the cave radius by, from the center point of the cave.
Description​

Description Properties​

JSON path: description

NameDefault ValueTypeDescription
identifiernot setStringThe name of this feature in the form 'namespace_name:feature_name'. 'feature_name' must match the filename.

Samples​

Example​

"minecraft:underwater_cave_carver_feature": {
"format_version": "1.13.0",
"minecraft:underwater_cave_carver_feature": {
"description": {
"identifier": "example:underground_cave_carver_feature"
},
"fill_with": "minecraft:water",
"width_modifier": 0,
"replace_air_with": "minecraft:flowing_water"
}
}

(Source: ms-learn, creator/Reference/Content/FeaturesReference/Examples/Features/minecraft_vegetation_patch_feature.md)

Feature Documentation - minecraft:vegetation_patch_feature​

Scatters vegetation in an area. The vegetation feature's appearance can be modified by adjusting the radius and depth that it will generate.

[!Note] This item requires a format version of at least 1.20.30.

Vegetation Patch Feature Properties​

NameDefault ValueTypeDescription
descriptionnot setDescription item
format_versionnot setString
replaceable_blocksnot setArray of strings
surfacenot setStringDetermines if a vegetation patch will grow from the ceiling or the floor.
vertical_rangenot setInteger numberVertical range used to determine a suitable surface position for the patch.
waterloggednot setBoolean true/falseIf true, waterlogs the positions occupied by the ground blocks.
Description​

Description Properties​

JSON path: description

NameDefault ValueTypeDescription
identifiernot setStringThe name of this feature in the form 'namespace_name:feature_name'. 'feature_name' must match the filename.

Samples​

Example​

"minecraft:vegetation_patch_feature": {
"format_version": "1.13.0",
"minecraft:vegetation_patch_feature": {
"description": {
"identifier": "example:clay_pool_with_dripleaves_feature"
},
"replaceable_blocks": [
"minecraft:clay",
"minecraft:moss_block",
"minecraft:sand",
"minecraft:gravel",
"minecraft:dirt",
"minecraft:coarse_dirt",
"minecraft:podzol",
"minecraft:dirt_with_roots",
"minecraft:grass_block",
"minecraft:mycelium",
"minecraft:stone",
"minecraft:cave_vines",
"minecraft:cave_vines_body_with_berries",
"minecraft:cave_vines_head_with_berries"
],
"ground_block": "minecraft:clay",
"vegetation_feature": "minecraft:dripleaf_feature",
"surface": "floor",
"depth": 3,
"vertical_range": 5,
"vegetation_chance": 0.1,
"horizontal_radius": {
"range_min": 4,
"range_max": 8
},
"extra_deep_block_chance": 0.8,
"extra_edge_column_chance": 0.7,
"waterlogged": true
}
}

(Source: ms-learn, creator/Reference/Content/FeaturesReference/Examples/Features/minecraft_weighted_random_feature.md)

Feature Documentation - minecraft:weighted_random_feature​

Selects and places a feature randomly based on weighted probabilities.

[!Note] This item requires a format version of at least 1.20.30.

Weighted Random Feature Properties​

NameDefault ValueTypeDescription
descriptionnot setDescription item
featuresnot setArray of strings
format_versionnot setString
Description​

Description Properties​

JSON path: description

NameDefault ValueTypeDescription
identifiernot setStringThe name of this feature in the form 'namespace_name:feature_name'. 'feature_name' must match the filename.

Samples​

Example​

"minecraft:weighted_random_feature": {
"format_version": "1.13.0",
"minecraft:weighted_random_feature": {
"description": {
"identifier": "example:select_flower_feature"
},
"features": [
[
"example:white_flower_feature",
1
],
[
"example:red_flower_feature",
2
],
[
"example:blue_flower_feature",
1
],
[
"example:yellow_flower_feature",
4
]
]
}
}

(Source: ms-learn, creator/Reference/Content/FeaturesReference/Examples/FeaturesIntroduction.md)

Introduction to Features​

Features are decorations scattered throughout the world. Things such as trees, plants, flowers, springs, ore, and coral are all features. Basically, if it isn't the terrain or an entity, it's probably a feature.

Features can be standalone or composed of multiple sub-features. In practice, most features in Minecraft are defined as a chain of two or more features. These chains typically end with features that place blocks in the world. Other feature types control flow such as conditional, sequential, or random distribution.

JSON format​

All features must specify the version that they target via the "format_version" field. The remainder of the data is contained in independent JSON sub-objects for each supported feature type. These feature types define the behavior of the feature and include properties specific to that behavior. To be valid, a definition must include exactly one of these type objects. (See the list of supported feature types.)

Example​
{
"format_version": "1.21.10",
"minecraft:scatter_feature": {
"description": {
"identifier": "example:scatter_flowers_feature"
},
"places_feature": "example:flower_feature",
"distribution": {
"iterations": 10,
"scatter_chance": 50.0,
"x": {
"distribution": "uniform",
"extent": [ 0, 15 ]
},
"y": 64,
"z": {
"distribution": "uniform",
"extent": [ 0, 15 ]
}
}
}
}

Adding Features​

Features are read from JSON files in the features subfolder of behavior packs. Loading enforces one feature per file; the file name and the name of the feature must match.

Feature names can include a namespace of the form "namespace:feature_name" to help distinguish them from features that may be in other behavior packs. This namespace is not considered when matching the filename to the feature name. For example, in a file called "my_tree_feature.json", both "my_tree_feature" and "my_pack_name:my_tree_feature" would be valid identifiers.

If two behavior packs define the same feature name (including namespace), then the feature from the highest pack in the stack will be used. This allows users to override base features.

Behavior pack definition​

To add features, you need to know the behavior pack structure for them.

In your behavior pack folder you will want to create a features folder and feature_rules folder. These two folders will contain all of the required JSON files to define your features.

The "min_engine_version" for the pack needs to be 1.20.20.

The features system does not require a resource pack.

If you are using structures in your features that contain custom blocks or items, you will need to follow the resource pack setup that adds the dependency of a resource pack.

There are examples of structures in the structure blocks sample behavior pack. There's more information about behavior packs in the Introduction to Behavior Packs article.

Supported features​
NameDescription
minecraft:aggregate_featureA collection of features in an arbitrary order.
minecraft:cave_carver_featureCarves a cave through the world in the current chunk, and in every chunk around the current chunk in an 8 radial pattern.
minecraft:fossil_featureGenerates a skeletal structure composed of bone blocks and parametric ore blocks.
minecraft:geode_featureGenerates a rock formation to simulate a geode.
minecraft:growing_plant_featurePlaces a growing plant in the world.
minecraft:nether_cave_carver_featureCarves a cave through the Nether in the current chunk, and in every chunk around the current chunk in an 8 radial pattern.
minecraft:multiface_featurePlaces one or a few multiface blocks on floors/walls/ceilings.
minecraft:ore_featurePlaces a vein of blocks to simulate ore deposits.
minecraft:scatter_featureScatters a feature throughout a chunk.
minecraft:search_featureSweeps a volume searching for a valid placement location for its referenced feature.
minecraft:sequence_featureA collection of features sequentially, in the order they appear in data.
minecraft:single_block_featurePlaces a single block in the world.
minecraft:snap_to_surface_featuresnaps the y-value of a feature placement pos to the floor or the ceiling within the provided vertical_search_range.
minecraft:Surface_relative_threshold_featureDetermines whether the provided position is below the estimated surface level of the world, and places a feature if so.If the provided position is above configured surface or the surface is not available, placement will fail. This feature only works for Overworld generators using world generation 1.18 or later.
minecraft:structure_template_featurePlaces a structure in the world. The structure must be stored as a .mcstructure file in the "structures" subdirectory of a behavior pack.
minecraft:tree_featurePlaces a tree in the world.
minecraft:underwater_cave_carver_featureCarves a cave through the world in the current chunk, and in every chunk around the current chunk in an 8 radial pattern.
minecraft:vegetation_patch_featureCarves a cave through the world in the current chunk, and in every chunk around the current chunk in an 8 radial pattern.
minecraft:weighted_random_featureRandomly selects and places a feature based on a weight value.
minecraft:multi_block_featurePlaces a multi-block in the world.
Unsupported features​

[!WARNING] These features existed in the original Features experiment but are no longer available.

NameDescription
minecraft:beards_and_shaversWould build a 'beard' or 'shave' out space so as to provide a clear space for a feature to place.
minecraft:conditional_listPlaced the first suitable feature within a collection.
minecraft:rect_layoutScanned the surface of a Chunk, calling place() on the surface of each block column.
minecraft:scan_surfaceScanned the surface of a Chunk, calling place() on the surface of each block column.

The Example Feature Schema document has an example of the full feature schema.

Feature rules​

Features must be attached to at least one biome in order to show up in the world. During world generation, biomes attempt to place their attached features chunk-by-chunk. Features can be attached via a feature rule definition.

Feature rules are separate JSON definition files found in the "feature_rules" subfolder of behavior packs. Feature rules follow the same filename rules as features. Each feature rule controls exactly one feature and serves as the root of a chain of feature data. To attach a feature to a biome with a feature rule, the "conditions" object must include the "minecraft:biome_filter" field. This is a list of filter tests that are performed on each biome to determine if the feature should be attached. Most relevant is the "has_biome_tag" test.

Biome names for use in the tag field can be found on the Entity Documentation - minecraft:biome_filter page.

To control the world generation pass at which a feature rule is applied, you can set the "placement_pass". Order is not guaranteed within each pass. These are the available "placement_pass" types:

  • first_pass
  • before_underground_pass
  • underground_pass
  • after_underground_pass
  • before_surface_pass
  • surface_pass
  • after_surface_pass
  • before_sky_pass
  • sky_pass
  • after_sky_pass
  • final_pass
Example: birch forest​
{
"format_version": "1.13.0",
"minecraft:feature_rules": {
"description": {
"identifier": "minecraft:birch_forest_surface_trees_feature",
"places_feature": "minecraft:legacy:birch_forest_tree_feature"
},
"conditions": {
"placement_pass": "surface_pass",
"minecraft:biome_filter": [
{
"test": "has_biome_tag",
"operator": "==",
"value": "forest"
},
{
"all_of": [
{
"test": "has_biome_tag",
"operator": "==",
"value": "birch"
},
{
"test": "has_biome_tag",
"operator": "!=",
"value": "mutated"
}
]
}
]
},
"distribution": {
"iterations": 1,
"x": 0,
"y": 0,
"z": 0
}
}
}
Feature rule schema​
{
version "format_version"
object "minecraft:feature_rules"
{
object "description"
{
string "identifier" // The name of this feature rule in the format 'namespace_name:rule_name'. 'rule_name' must match the filename.
feature_reference "places_feature" // Named reference to the feature controlled by this rule.
}
object "conditions" // Parameters to control where and when the feature will be placed.
{
string "placement_pass" // When the feature should be placed relative to others. Earlier passes in the list are guaranteed to occur before later passes. Order is not guaranteed within each pass.
biome_filter_group "minecraft:biome_filter" : opt // List of filter tests to determine which biomes this rule will attach to. Object of type FilterGroup
}
object "distribution" : opt // Parameters controlling the initial scatter of the feature. Object of type ScatterParams
}
}
Coordinate Evaluation Order​

CoordinateEvaluationOrder enumerator, supported values are: "xyz", "xzy", "yxz", "yzx", "zxy", "zyx".

Coordinate Range​

Represents the scatter distribution over a coordinate (x/y/z), can also be built by an expression.

NameTypeRequired?Description
distributionn/aRequiredType of distribution. Supported distributions are defined by "Random Distribution Type".
extentArrayRequiredLower and upper bound (inclusive) of the scatter range, as an offset from the input point to scatter around.
grid_offsetIntegerOptionalWhen the distribution type is grid, defines the offset along this axis.
step_sizeIntegerOptionalWhen the distribution type is grid, defines the distance between steps along this axis.
Feature Rule Conditions​
NameTypeRequired?Description
minecraft:biome_filterObject of type Filter GroupOptionalList of which filter tests are attached to which biomes.
placement_passStringRequiredWhen the feature should be placed relative to others. Earlier passes in the list are guaranteed to occur before later passes. Order is not guaranteed within each pass.
Feature Rule Definition​
NameTypeRequired?Description
conditionsObject of type Feature Rule ConditionsRequiredParameters to control where and when the feature will be placed.
descriptionObject of type Feature Rule DescriptionRequiredIdentifier for the Feature Rule and Feature to place.
distributionObject of type Scatter ParamsOptionalParameters controlling the initial scatter of the feature.
Feature Rule Description​
NameTypeRequired?Description
identifierStringRequiredThe name of this feature rule in the format namespace_name:rule_name. rule_name must match the filename.
places_featureStringRequiredNamed reference to the feature controlled by this rule.
Filter Group​

Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects.

NameTypeRequired?Description
ANDObject of type Filter GroupOptionalEvaluates all tests in the group, all must pass in order for the group to pass.
NOTObject of type Filter GroupOptionalEvaluates all tests in the group, all must fail in order for the group to pass.
ORObject of type Filter GroupOptionalEvaluates tests in the group, one or more must pass in order for the group to pass.
allObject of type Filter GroupOptionalEvaluates all tests in the group, all must pass in order for the group to pass.
all_ofObject of type Filter GroupOptionalEvaluates all tests in the group, all must pass in order for the group to pass.
anyObject of type Filter GroupOptionalEvaluates tests in the group, one or more must pass in order for the group to pass.
any_ofObject of type Filter GroupOptionalEvaluates tests in the group, one or more must pass in order for the group to pass.
none_ofObject of type Filter GroupOptionalEvaluates all tests in the group, all must fail in order for the group to pass
Filter Test​
NameTypeRequired?Description
domainObjectOptionalThe domain the test should be performed in.
operatorObjectOptionalThe comparison to apply with 'value'.
subjectObjectOptionalThe subject of this filter test
testStringRequiredThe name of the test to apply.
valueObjectOptionalOptionalThe value being compared with the test.
Random Distribution Type​

RandomDistributionType enumerator, supported values are: "uniform", "gaussian", "inverse_gaussian", "triangle", "fixed_grid", "jittered_grid".

Scatter Chance​

Scatter probability represented by an expression or an object with a numerator and denominator.

NameTypeRequired?Description
denominatorIntegerRequiredDenominator for scatter probability.
numeratorIntegerRequiredNumerator for scatter probability.
Scatter params​

Controls the scatter distribution of a particular object.

NameTypeRequired?Description
coordinate_eval_ordernot setOptionalThe order in which coordinates will be evaluated. Should be used when a coordinate depends on another. If omitted, defaults to "xzy". Supported orders are defined by "Coordinate Evaluation Order".
iterationsIntegerRequiredNumber of times the placement will be attempted. Greater values will mean a greater concentration of items placed.
scatter_chanceObject of type Scatter ChanceOptionalProbability that this scatter will occur. Not evaluated each iteration; either no iterations will run, or all will.
xObject of type Coordinate RangeRequiredDistribution for the coordinate (evaluated each iteration).
yObject of type Coordinate RangeRequiredDistribution for the coordinate (evaluated each iteration).
zObject of type Coordinate RangeRequiredDistribution for the coordinate (evaluated each iteration).

Feature samples​

All currently listed features as of version 1.20.40 have been combined into a sample pack that can be used in your world as a tutorial to further learn how the feature and feature rules work.

Additionally, check the feature and feature_rules folders of the latest Minecraft Dedicated Server for examples of Vanilla feature rules.

Sources
idSourceLicenseCommitAccessed
ms-learnMinecraft Creator documentation (Microsoft Learn)CC BY 4.0 (documentation), MIT (code)a9fd1c02026-11-13