Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Placed feature: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Sync: updated from Minecraft
SyncBot (talk | contribs)
Sync: updated from Minecraft
 
(3 intermediate revisions by the same user not shown)
Line 9: Line 9:
<div class="treeview">
<div class="treeview">
* {{nbt|compound}}: Root object.
* {{nbt|compound}}: Root object.
** {{nbt|string}}{{nbt|compound|feature}}: {{json ref|configured feature|inline=1}} &mdash; The feature to place.
** {{nbt|string}}{{nbt|compound|feature}}: {{json ref|configured feature|inline=1}}   &mdash; The feature to place.
** {{nbt|list|placement}}: A list of placement modifiers, applied in order.
** {{nbt|list|placement}}: A list of placement modifiers, applied in order.
*** {{nbt|compound}}: A placement modifier.
*** {{nbt|compound}}: A placement modifier.
Line 24: Line 24:


<div class="treeview" id="biome" style="margin-top: 1em;">
<div class="treeview" id="biome" style="margin-top: 1em;">
* '''biome'''&mdash;Returns the current position if the biome at that position includes this placed feature, otherwise returns empty. No additional field. In effect, this predicate restricts features from being placed outside the edges of any biome that generates the feature. This modifier type cannot be used in placed features that are referenced from other configured features (for example, from entries in a random_selector type feature). Minecraft does not catch this type of error automatically on trying to load the world; instead the game runs normally until it tries to generate the feature, which causes the game to crash.
* '''biome'''   &mdash; Returns the current position if the biome at that position includes this placed feature, otherwise returns empty. No additional field. In effect, this predicate restricts features from being placed outside the edges of any biome that generates the feature. This modifier type cannot be used in placed features that are referenced from other configured features (for example, from entries in a random_selector type feature). Minecraft does not catch this type of error automatically on trying to load the world; instead the game runs normally until it tries to generate the feature, which causes the game to crash.
* '''block_predicate_filter'''&mdash;Returns the current position when the predicate is passed, otherwise return empty.
</div>
 
<div class="treeview" id="block_predicate_filter" style="margin-top: 1em;">
* '''block_predicate_filter''' &mdash; Returns the current position when the predicate is passed, otherwise return empty.
** {{nbt|compound|predicate}}: The [[Minecraft:block predicate]] to test.
** {{nbt|compound|predicate}}: The [[Minecraft:block predicate]] to test.
*** {{list indent|*|{{#lst:block predicate|json format}}}}
*** {{list indent|*|{{#lst:block predicate|json format}}}}
</div>
<div class="treeview" id="carving_mask" style="margin-top: 1em;">
* '''carving_mask'''&mdash;Returns all positions in the current chunk that have been carved out by a carver. This does not include blocks carved out by noise caves.
** {{nbt|string|step}}: The carving step. Either <code>air</code> or <code>liquid</code>. 'Liquid'-type carvers are not used in vanilla.
</div>
</div>


<div class="treeview" id="count" style="margin-top: 1em;">
<div class="treeview" id="count" style="margin-top: 1em;">
* '''count'''&mdash;Returns multiple copies of the current block position. Although the count is limited to 4096, multiple count predicates can be used, allowing them to be stacked multiplicatively to achieve much higher values.
* '''count''' &mdash; Returns multiple copies of the current block position. Although the count is limited to 4096, multiple count predicates can be used, allowing them to be stacked multiplicatively to achieve much higher values.
** {{nbt|int}}{{nbt|compound|count}}: Value between 0 and 4096 (inclusive).
** {{nbt|int}}{{nbt|compound|count}}: Value between 0 and 4096 (inclusive).
*** {{nbt inherit/int_provider}}
*** {{nbt inherit/int_provider}}
Line 42: Line 40:


<div class="treeview" id="count_on_every_layer" style="margin-top: 1em;">
<div class="treeview" id="count_on_every_layer" style="margin-top: 1em;">
* '''count_on_every_layer'''&mdash;In the horizontal relative range (0,0) to (16,16), at each vertical layer separated by air, lava or water, tries to randomly select the specified number of horizontal positions, whose Y coordinate is one block above this layer at this selected horizontal position. Return these selected positions.
* '''count_on_every_layer''' &mdash; In the horizontal relative range (0,0) to (16,16), at each vertical layer separated by air, lava or water, tries to randomly select the specified number of horizontal positions, whose Y coordinate is one block above this layer at this selected horizontal position. Return these selected positions.
** {{nbt|int}}{{nbt|compound|count}}:Count on each layer. Value between 0 and 256 (inclusive).
** {{nbt|int}}{{nbt|compound|count}}:Count on each layer. Value between 0 and 256 (inclusive).
*** {{nbt inherit/int_provider}}
*** {{nbt inherit/int_provider}}
</div>
<div class="treeview" id="cuboid" style="margin-top: 1em;">
* '''cuboid'''{{upcoming|JE 26.3}} &mdash; Repeats a feature in a cuboid shape.
** {{nbt|int}}{{nbt|compound|xz_size}}: The size of the cuboid along the x and z axes. Value between 1 and 16 (inclusive).
** {{nbt|int}}{{nbt|compound|y_size}}: The size of the cuboid along the y axis. Value between 1 and 16 (inclusive).
*** {{nbt inherit/int_provider}}
** {{nbt|boolean}}{{nbt|compound|include_interior}}: Optional; Whether to place interior blocks of the cuboid. Defaults to {{cd|true}}.
** {{nbt|boolean}}{{nbt|compound|include_edges}}: Optional; Whether to place edge blocks of the cuboid. Defaults to {{cd|true}}. If set to {{cd|false}}, the cuboid is generated as "somewhat rounded".<ref>{{mcnet|minecraft-26-3-snapshot-3|Minecraft 26.3 Snapshot 3|July 7, 2026|Java Team}}</ref>
</div>
</div>


<div class="treeview" id="environment_scan" style="margin-top: 1em;">
<div class="treeview" id="environment_scan" style="margin-top: 1em;">
* '''environment_scan'''&mdash;Scans blocks either up or down, until the target condition is met. Returns the block position for which the target condition matches. If no target can be found within the maximum number of steps, returns empty.
* '''environment_scan''' &mdash; Scans blocks either up or down, until the target condition is met. Returns the block position for which the target condition matches. If no target can be found within the maximum number of steps, returns empty.
** {{nbt|string|direction_of_search}}: One of <code>up</code> or <code>down</code>.
** {{nbt|string|direction_of_search}}: One of <code>up</code> or <code>down</code>.
** {{nbt|int|max_steps}}: Value between 1 and 32 (inclusive).
** {{nbt|int|max_steps}}: Value between 1 and 32 (inclusive).
Line 58: Line 65:


<div class="treeview" id="fixed_placement" style="margin-top: 1em;">
<div class="treeview" id="fixed_placement" style="margin-top: 1em;">
* '''fixed_placement'''&mdash;Returns all specified positions, if they are in the current chunk.
* '''fixed_placement''' &mdash; Returns all specified positions, if they are in the current chunk.
** {{nbt|list|positions}}: A list of all placement positions
** {{nbt|list|positions}}: A list of all placement positions
*** {{nbt|list}}: A position
*** {{nbt|list}}: A position
Line 67: Line 74:


<div class="treeview" id="height_range" style="margin-top: 1em;">
<div class="treeview" id="height_range" style="margin-top: 1em;">
* '''height_range'''&mdash;Sets the Y coordinate to a value provided by a height provider. Returns the new position.
* '''height_range''' &mdash; Sets the Y coordinate to a value provided by a height provider. Returns the new position.
** {{nbt|compound|height}}: The new Y coordinate.
** {{nbt|compound|height}}: The new Y coordinate.
*** {{nbt inherit/height_provider}}
*** {{nbt inherit/height_provider}}
Line 73: Line 80:


<div class="treeview" id="heightmap" style="margin-top: 1em;">
<div class="treeview" id="heightmap" style="margin-top: 1em;">
* '''heightmap'''&mdash;Sets the Y coordinate to one block above the [[Minecraft:heightmap]]. Returns the new position.
* '''heightmap''' &mdash; Sets the Y coordinate to one block above the [[Minecraft:heightmap]]. Returns the new position.
** {{nbt|string|heightmap}}: The heightmap to use. One of <code>MOTION_BLOCKING</code>, <code>MOTION_BLOCKING_NO_LEAVES</code>, <code>OCEAN_FLOOR</code>, <code>OCEAN_FLOOR_WG</code>, <code>WORLD_SURFACE</code> or <code>WORLD_SURFACE_WG</code>.
** {{nbt|string|heightmap}}: The heightmap to use. One of <code>MOTION_BLOCKING</code>, <code>MOTION_BLOCKING_NO_LEAVES</code>, <code>OCEAN_FLOOR</code>, <code>OCEAN_FLOOR_WG</code>, <code>WORLD_SURFACE</code> or <code>WORLD_SURFACE_WG</code>.
</div>
</div>


<div class="treeview" id="in_square" style="margin-top: 1em;">
<div class="treeview" id="in_square" style="margin-top: 1em;">
* '''in_square'''&mdash;For both X and Z, it adds a random value between 0 and 15 (both inclusive). This is a shortcut for a random_offset modifier with y_spread set to 0 and xz_spread as a uniform int from 0 to 15. No additional fields.
* '''in_square''' &mdash; For both X and Z, it adds a random value between 0 and 15 (both inclusive). This is a shortcut for a random_offset modifier with y_spread set to 0 and xz_spread as a uniform int from 0 to 15. No additional fields.
</div>
</div>


<div class="treeview" id="noise_based_count" style="margin-top: 1em;">
<div class="treeview" id="noise_based_count" style="margin-top: 1em;">
* '''noise_based_count'''&mdash;When the noise value at the current block position is positive, returns multiple copies of the current block position, whose count is based on a noise value and can gradually change based on the noise value. When noise value is negative or 0, returns empty. The count is calculated by <code>ceil((noise(x / noise_factor, z / noise_factor) + noise_offset) * noise_to_count_ratio)</code>.
* '''noise_based_count''' &mdash; When the noise value at the current block position is positive, returns multiple copies of the current block position, whose count is based on a noise value and can gradually change based on the noise value. When noise value is negative or 0, returns empty. The count is calculated by <code>ceil((noise(x / noise_factor, z / noise_factor) + noise_offset) * noise_to_count_ratio)</code>.
** {{nbt|double|noise_factor}}: Scales the noise input horizontally. Higher values make for wider and more spaced out peaks.
** {{nbt|double|noise_factor}}: Scales the noise input horizontally. Higher values make for wider and more spaced out peaks.
** {{nbt|double|noise_offset}}:(optional, defaults to 0) Vertical offset of the noise.
** {{nbt|double|noise_offset}}:(optional, defaults to 0) Vertical offset of the noise.
Line 89: Line 96:


<div class="treeview" id="noise_threshold_count" style="margin-top: 1em;">
<div class="treeview" id="noise_threshold_count" style="margin-top: 1em;">
* '''noise_threshold_count'''&mdash;Returns multiple copies of the current block position. The count is either below_noise or above_noise, based on the noise value at the current block position. First checks <code>noise(x / 200, z / 200) < noise_level</code>. If that is true, uses <code>below_noise</code>, otherwise <code>above_noise</code>.
* '''noise_threshold_count''' &mdash; Returns multiple copies of the current block position. The count is either below_noise or above_noise, based on the noise value at the current block position. First checks <code>noise(x / 200, z / 200) < noise_level</code>. If that is true, uses <code>below_noise</code>, otherwise <code>above_noise</code>.
** {{nbt|double|noise_level}}: The threshold within the noise of when to use <code>below_noise</code> or <code>above_noise</code>.
** {{nbt|double|noise_level}}: The threshold within the noise of when to use <code>below_noise</code> or <code>above_noise</code>.
** {{nbt|int|below_noise}}: The count when the noise is below the threshold. Value lower than 0 is treated as 0.
** {{nbt|int|below_noise}}: The count when the noise is below the threshold. Value lower than 0 is treated as 0.
** {{nbt|int|above_noise}}: The count when the noise is above the threshold. Value lower than 0 is treated as 0.
** {{nbt|int|above_noise}}: The count when the noise is above the threshold. Value lower than 0 is treated as 0.
</div>
<div class="treeview" id="random_chance" style="margin-top: 1em;">
* '''random_chance'''{{upcoming|JE 26.3}} &mdash; Gates the feature being placed behind a random chance.
** {{nbt|float}}{{nbt|compound|chance}}: Value between 0 and 1 representing the chance that the feature gets placed.
</div>
</div>


<div class="treeview" id="random_offset" style="margin-top: 1em;">
<div class="treeview" id="random_offset" style="margin-top: 1em;">
* '''random_offset'''&mdash;Applies an offset to the current position. Contrary to its name, the applied offset is only random if the specified integer provider isn't a constant. In other words, a y_spread of -12 will always offset the placed feature downwards by 12 blocks. Also note that the even though the x and z axes share the same integer provider, they are sampled individually, so, for example, if a <code>uniform</code> type integer provider is used for the xz_spread with a min of 4 and a max of 16, the x offset could be 12 while the z offset could be 5. Specifying unique X and Z values isn't possible.
* '''random_offset'''{{until|JE 26.3}} / '''offset'''{{upcoming|JE 26.3}} &mdash; Applies an offset to the current position. Contrary to its name, the applied offset is only random if the specified integer provider isn't a constant. In other words, a y_spread of -12 will always offset the placed feature downwards by 12 blocks. Also note that the even though the x and z axes share the same integer provider, they are sampled individually, so, for example, if a <code>uniform</code> type integer provider is used for the xz_spread with a min of 4 and a max of 16, the x offset could be 12 while the z offset could be 5. Specifying unique X and Z values isn't possible.
** {{nbt|int}}{{nbt|compound|xz_spread}}: Value between -16 and 16 (inclusive).
** {{nbt|int}}{{nbt|compound|xz_spread}}{{until|JE 26.3}}: Value between -16 and 16 (inclusive).
*** {{nbt inherit/int_provider}}
*** {{nbt inherit/int_provider}}
** {{nbt|int}}{{nbt|compound|y_spread}}: Value between -16 and 16 (inclusive).
** {{nbt|int}}{{nbt|compound|y_spread}}{{until|JE 26.3}}: Value between -16 and 16 (inclusive).
*** {{nbt inherit/int_provider}}
** {{nbt|int}}{{nbt|compound|x}}{{upcoming|JE 26.3}}: Value between -16 and 16 (inclusive).
** {{nbt|int}}{{nbt|compound|y}}{{upcoming|JE 26.3}}: Value between -16 and 16 (inclusive).
** {{nbt|int}}{{nbt|compound|z}}{{upcoming|JE 26.3}}: Value between -16 and 16 (inclusive).
*** {{nbt inherit/int_provider}}
*** {{nbt inherit/int_provider}}
</div>
</div>


<div class="treeview" id="rarity_filter" style="margin-top: 1em;">
<div class="treeview" id="rarity_filter" style="margin-top: 1em;">
* '''rarity_filter'''&mdash;Either returns the current position or empty. The chance is calculated as <code>1 / chance</code>.
* '''rarity_filter''' &mdash; Either returns the current position or empty. The chance is calculated as <code>1 / chance</code>.
** {{nbt|int|chance}}: Must be a positive integer.
** {{nbt|int|chance}}: Must be a positive integer.
</div>
</div>


<div class="treeview" id="surface_relative_threshold_filter" style="margin-top: 1em;">
<div class="treeview" id="surface_relative_threshold_filter" style="margin-top: 1em;">
* '''surface_relative_threshold_filter'''&mdash;Returns the current position if the surface is inside a range. Otherwise returns empty.
* '''surface_relative_threshold_filter''' &mdash; Returns the current position if the surface is inside a range. Otherwise returns empty.
** {{nbt|string|heightmap}}:The [[Minecraft:heightmap]] to use. One of <code>MOTION_BLOCKING</code>, <code>MOTION_BLOCKING_NO_LEAVES</code>, <code>OCEAN_FLOOR</code>, <code>OCEAN_FLOOR_WG</code>, <code>WORLD_SURFACE</code> or <code>WORLD_SURFACE_WG</code>.
** {{nbt|string|heightmap}}:The [[Minecraft:heightmap]] to use. One of <code>MOTION_BLOCKING</code>, <code>MOTION_BLOCKING_NO_LEAVES</code>, <code>OCEAN_FLOOR</code>, <code>OCEAN_FLOOR_WG</code>, <code>WORLD_SURFACE</code> or <code>WORLD_SURFACE_WG</code>.
** {{nbt|int|min_inclusive}}: The minimum relative height from the surface to current position.
** {{nbt|int|min_inclusive}}: The minimum relative height from the surface to current position.
Line 116: Line 132:


<div class="treeview" id="surface_water_depth_filter" style="margin-top: 1em;">
<div class="treeview" id="surface_water_depth_filter" style="margin-top: 1em;">
* '''surface_water_depth_filter'''&mdash;If the number of blocks of a motion blocking [[Minecraft:material]] under the surface (the top non-air block) is less than the specified depth, return the current position. Otherwise return empty.
* '''surface_water_depth_filter''' &mdash; If the number of blocks of a motion blocking [[Minecraft:material]] under the surface (the top non-air block) is less than the specified depth, return the current position. Otherwise return empty.
** {{nbt|int|max_water_depth}}: The maximum allowed depth.
** {{nbt|int|max_water_depth}}: The maximum allowed depth.
</div>
</div>
Line 123: Line 139:
{{HistoryTable
{{HistoryTable
|{{HistoryLine|java}}
|{{HistoryLine|java}}
|{{HistoryLine||1.18|dev=pre1|Introduced placed features, stored in {{cd|worldgen/placed_feature}} directory}}
|{{HistoryLine||1.18|dev=pre1|Introduced placed features, stored in {{cd|worldgen/placed_feature}} directory.}}
|{{HistoryLine||1.21|dev=pre2|Added {{cd|fixed_placement}} placement modifier}}
|{{HistoryLine||1.21|dev=pre2|Added {{cd|fixed_placement}} placement modifier.}}
|{{HistoryLine||1.21.2|dev=24w33a|Removed {{cd|carving_mask}} placement modifier}}|{{HistoryLine||26.1|dev=pre3|Changed the maximum value of {{cd|count}} field from {{cd|count}} placement modifier to 4096}}}}
|{{HistoryLine||1.21.2|dev=24w33a|Removed {{cd|carving_mask}} placement modifier.}}
|{{HistoryLine||26.1|dev=pre3|Changed the maximum value of {{nbt|int}}{{nbt|compound|count}} field from {{cd|count}} placement modifier to 4096.}}
|{{HistoryLine|java upcoming}}
|{{HistoryLine||26.3|dev=snap2|Renamed {{cd|random_offset}} to {{cd|offset}}.
|Removed {{cd|offset}} fields {{cd|xz_spread}} and {{cd|y_spread}}.
|Added {{cd|offset}} fields {{cd|x}}, {{cd|y}} and {{cd|z}}.}}
|{{HistoryLine|||dev=snap3|Added {{cd|cuboid}} and {{cd|random_chance}} placement modifiers.}}
}}
 
=== Removed modifiers ===
 
Added in [[Minecraft:Java Edition 1.18 Pre-release 1|1.18 Pre-release 1]]. Removed in [[Minecraft:24w33a]]:
<div class="treeview" id="carving_mask" style="margin-top: 1em;">
* '''carving_mask''' &mdash; Returns all positions in the current chunk that have been carved out by a carver. This does not include blocks carved out by noise caves.
** {{nbt|string|step}}: The carving step. Either <code>air</code> or <code>liquid</code>. 'Liquid'-type carvers are not used in vanilla.
</div>
 
== References ==
{{reflist}}


== External links ==
== External links ==

Latest revision as of 11:14, 8 July 2026

Template:Exclusive

A placed feature determines where a Minecraft:configured feature should be attempted to be placed using placement modifiers. They can be referenced in biomes.

Placed features are stored as JSON files within a data pack, in the Template:Cd folder.

JSON format

Placement modifiers

When a placed feature is referenced through a biome file, the placed feature tells the configured feature in the Template:Cd field to place once on the northwest corner of each chunk at the bottom layer of the world. When a placed feature is referenced from a configured feature file or through the Template:Cmd command, the placed feature tells the configured feature in the Template:Cd field to place once where the original feature/player is located respectively. Placement modifiers can change the position of the feature and the amount of placements.

Placed features are applied in order to determine where feature placement attempt(s) should occur. This can include moving the placement's position, number of positions, and filtering out positions based on given conditions. Each placement attempt applies placement modifiers separately.

The possible values for Template:Nbt and associated additional fields:

  • biome — Returns the current position if the biome at that position includes this placed feature, otherwise returns empty. No additional field. In effect, this predicate restricts features from being placed outside the edges of any biome that generates the feature. This modifier type cannot be used in placed features that are referenced from other configured features (for example, from entries in a random_selector type feature). Minecraft does not catch this type of error automatically on trying to load the world; instead the game runs normally until it tries to generate the feature, which causes the game to crash.
  • count — Returns multiple copies of the current block position. Although the count is limited to 4096, multiple count predicates can be used, allowing them to be stacked multiplicatively to achieve much higher values.
  • count_on_every_layer — In the horizontal relative range (0,0) to (16,16), at each vertical layer separated by air, lava or water, tries to randomly select the specified number of horizontal positions, whose Y coordinate is one block above this layer at this selected horizontal position. Return these selected positions.
  • heightmap — Sets the Y coordinate to one block above the Minecraft:heightmap. Returns the new position.
    • Template:Nbt: The heightmap to use. One of MOTION_BLOCKING, MOTION_BLOCKING_NO_LEAVES, OCEAN_FLOOR, OCEAN_FLOOR_WG, WORLD_SURFACE or WORLD_SURFACE_WG.
  • in_square — For both X and Z, it adds a random value between 0 and 15 (both inclusive). This is a shortcut for a random_offset modifier with y_spread set to 0 and xz_spread as a uniform int from 0 to 15. No additional fields.
  • noise_based_count — When the noise value at the current block position is positive, returns multiple copies of the current block position, whose count is based on a noise value and can gradually change based on the noise value. When noise value is negative or 0, returns empty. The count is calculated by ceil((noise(x / noise_factor, z / noise_factor) + noise_offset) * noise_to_count_ratio).
    • Template:Nbt: Scales the noise input horizontally. Higher values make for wider and more spaced out peaks.
    • Template:Nbt:(optional, defaults to 0) Vertical offset of the noise.
    • Template:Nbt: Ratio of noise value to count.
  • noise_threshold_count — Returns multiple copies of the current block position. The count is either below_noise or above_noise, based on the noise value at the current block position. First checks noise(x / 200, z / 200) < noise_level. If that is true, uses below_noise, otherwise above_noise.
    • Template:Nbt: The threshold within the noise of when to use below_noise or above_noise.
    • Template:Nbt: The count when the noise is below the threshold. Value lower than 0 is treated as 0.
    • Template:Nbt: The count when the noise is above the threshold. Value lower than 0 is treated as 0.
  • rarity_filter — Either returns the current position or empty. The chance is calculated as 1 / chance.
  • surface_relative_threshold_filter — Returns the current position if the surface is inside a range. Otherwise returns empty.
    • Template:Nbt:The Minecraft:heightmap to use. One of MOTION_BLOCKING, MOTION_BLOCKING_NO_LEAVES, OCEAN_FLOOR, OCEAN_FLOOR_WG, WORLD_SURFACE or WORLD_SURFACE_WG.
    • Template:Nbt: The minimum relative height from the surface to current position.
    • Template:Nbt: The maximum relative height from the surface to current position.
  • surface_water_depth_filter — If the number of blocks of a motion blocking Minecraft:material under the surface (the top non-air block) is less than the specified depth, return the current position. Otherwise return empty.

History

Template:HistoryTable

Removed modifiers

Added in 1.18 Pre-release 1. Removed in Minecraft:24w33a:

  • carving_mask — Returns all positions in the current chunk that have been carved out by a carver. This does not include blocks carved out by noise caves.
    • Template:Nbt: The carving step. Either air or liquid. 'Liquid'-type carvers are not used in vanilla.

References

Template:Reflist

External links

Navigation

Template:Navbox Java Edition technical

Minecraft:de:Merkmalplatzierungsdefinition Minecraft:fr:Élément du terrain placé Minecraft:ko:설치되는 지물 Minecraft:pt:Recurso colocado Minecraft:zh:已放置的地物