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

Minecraft:Block state provider: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Sync: updated from Minecraft
SyncBot (talk | contribs)
Sync: updated from Minecraft
 
(4 intermediate revisions by the same user not shown)
Line 13: Line 13:
The following block state provider types exist.
The following block state provider types exist.


=== copy_properties_provider ===
=== copy_properties ===
Copies common block state properties from the block at the evaluated position to the resulting state.{{upcoming|JE 26.3}}
Copies common block state properties from the block at the evaluated position to the resulting state.
<div class="treeview">
<div class="treeview">
* {{nbt|compound}}: A block state provider
* {{nbt|compound}}: A block state provider
** {{nbt|string|type}}: <code>copy_properties_provider</code>
** {{nbt|string|type}}: <code>copy_properties</code>
** {{Nbt|string|source}}: Provides the block state which the copied properties are copied on top of. Only properties common between both the source and the target blocks will be copied.
** {{nbt|compound|source}}: Provides the block state which the copied properties are copied on top of. Only properties common between both the source and the target blocks will be copied
*** {{nbt|string|id}}: block id
*** {{nbt|compound|properties}}: block properties
</div>
</div>


=== dual_noise_provider ===
=== dual_noise ===
Randomly chooses a block state according to two noise values.
Randomly chooses a block state according to two noise values.
<div class="treeview">
<div class="treeview">
* {{nbt|compound}}: A block state provider
* {{nbt|compound}}: A block state provider
** {{nbt|string|type}}: <code>dual_noise_provider</code>{{until|JE 26.3}} / <code>dual_noise</code>{{upcoming|JE 26.3}}
** {{nbt|string|type}}: <code>dual_noise</code>
** {{Nbt|long|seed}}: The seed of the noise.
** {{Nbt|long|seed}}: The seed of the noise.
** {{Nbt|compound|noise}}: A noise.
** {{Nbt|compound|noise}}: A noise.
Line 43: Line 45:
</div>
</div>


=== noise_provider ===
=== noise ===
Randomly chooses a block state according to a noise value.
Randomly chooses a block state according to a noise value.
<div class="treeview">
<div class="treeview">
* {{nbt|compound}}: A block state provider
* {{nbt|compound}}: A block state provider
** {{nbt|string|type}}: <code>noise_provider</code>{{until|JE 26.3}} / <code>noise</code>{{upcoming|JE 26.3}}
** {{nbt|string|type}}: <code>noise</code>
** {{Nbt|long|seed}}: The seed of the noise.
** {{Nbt|long|seed}}: The seed of the noise.
** {{Nbt|compound|noise}}: A noise.
** {{Nbt|compound|noise}}: A noise.
Line 56: Line 58:
</div>
</div>


=== noise_threshold_provider ===
=== noise_threshold ===
Uses different block states when a noise value above or below the threshold.
Uses different block states when a noise value above or below the threshold.
<div class="treeview">
<div class="treeview">
* {{nbt|compound}}: A block state provider
* {{nbt|compound}}: A block state provider
** {{nbt|string|type}}: <code>noise_threshold_provider</code>{{until|JE 26.3}} / <code>noise_threshold</code>{{upcoming|JE 26.3}}
** {{nbt|string|type}}: <code>noise_threshold</code>
** {{Nbt|long|seed}}: The seed of the noise.
** {{Nbt|long|seed}}: The seed of the noise.
** {{Nbt|compound|noise}}: A noise.
** {{Nbt|compound|noise}}: A noise.
Line 76: Line 78:
</div>
</div>


=== random_block_provider ===
=== random_block ===
Returns the default block state for a randomly chosen block.{{upcoming|JE 26.3}}
Returns the default block state for a randomly chosen block.
<div class="treeview">
<div class="treeview">
* {{nbt|compound}}: A block state provider
* {{nbt|compound}}: A block state provider
** {{nbt|string|type}}: <code>random_block_provider</code>{{until|JE 26.3}} / <code>random_block</code>{{upcoming|JE 26.3}}
** {{nbt|string|type}}: <code>random_block</code>
** {{nbt|string}}{{nbt|compound}}{{nbt|list|blocks}}: {{json ref|block|tag=1|inline=1}}; Cannot be empty &mdash; Blocks to choose from.
** {{nbt|string}}{{nbt|compound}}{{nbt|list|blocks}}: {{json ref|block|tag=1|inline=1}}; Cannot be empty &mdash; Blocks to choose from.
*** {{nbt inherit/block_state}}
*** {{nbt inherit/block_state}}
</div>
</div>


=== randomized_int_state_provider ===
=== randomized_int ===
Assigns a random value to an integer block property.
Assigns a random value to an integer block property.
<div class="treeview">
<div class="treeview">
* {{nbt|compound}}: A block state provider
* {{nbt|compound}}: A block state provider
** {{nbt|string|type}}: <code>randomized_int_state_provider</code>{{until|JE 26.3}} / <code>randomized_int</code>{{upcoming|JE 26.3}}
** {{nbt|string|type}}: <code>randomized_int</code>
** {{Nbt|string|property}}: The name of a block property.
** {{Nbt|string|property}}: The name of a block property.
** {{Nbt|int}}{{Nbt|compound|values}}: The value of the block property.
** {{Nbt|int}}{{Nbt|compound|values}}: The value of the block property.
Line 97: Line 99:
</div>
</div>


=== rotated_block_provider ===
=== rotated ===
Randomly rotates axially-rotated blocks{{until|JE 26.3}} / any block with {{cd|axis}} or {{cd|facing}} properties.{{upcoming|JE 26.3}}
Randomly rotates any block with {{cd|axis}} or {{cd|facing}} properties.
<div class="treeview">
<div class="treeview">
* {{nbt|compound}}: A block state provider
* {{nbt|compound}}: A block state provider
** {{nbt|string|type}}: <code>rotated_block_provider</code>{{until|JE 26.3}} / <code>rotated</code>{{upcoming|JE 26.3}}
** {{nbt|string|type}}: <code>rotated</code>
** {{nbt|compound|state}}: The block ID to use. The block properties are ignored.{{until|JE 26.3}} / A block state provider{{upcoming|JE 26.3}}
** {{nbt|compound|state}}: A block state provider
** {{nbt|compound|direction}}{{upcoming|JE 26.3}}: Optional. Describes the direction to set. If omitted, a random direction is chosen.
** {{nbt|compound|direction}}: Optional. Describes the direction to set. If omitted, a random direction is chosen.
*** {{nbt inherit/block_state}}
*** {{nbt inherit/block_state}}
</div>
</div>


=== rule_based_state_provider ===
=== rule_based ===
Provides a block state depending on the current block(s) by matching a sequence of rules.
Provides a block state depending on the current block(s) by matching a sequence of rules.
<div class="treeview"><section begin="json format" />
<div class="treeview"><section begin="json format" />
* {{nbt|compound}}: A block state provider
* {{nbt|compound}}: A block state provider
** {{nbt|string|type}}: <code>rule_based_state_provider</code>{{until|JE 26.3}} / <code>rule_based</code>{{upcoming|JE 26.3}}
** {{nbt|string|type}}: <code>rule_based</code>
** {{Nbt|compound|fallback}} The block to use when no rules' predicates match. This field is optional. If unspecified and no rules' predicates match, then no block is placed.
** {{Nbt|compound|fallback}} The block to use when no rules' predicates match. This field is optional. If unspecified and no rules' predicates match, then no block is placed.
*** {{Nbt inherit/block state provider}}
*** {{Nbt inherit/block state provider}}
Line 122: Line 124:
</div>
</div>


=== simple_state_provider ===
=== simple ===
Specifies a single block state directly
Specifies a single block state directly
<div class="treeview">
<div class="treeview">
* {{nbt|compound}}: A block state provider
* {{nbt|compound}}: A block state provider
** {{nbt|string|type}}: <code>simple_state_provider</code>{{until|JE 26.3}} / <code>simple</code>{{upcoming|JE 26.3}}
** {{nbt|string|type}}: <code>simple</code>
** {{nbt|compound|state}}: The block state to use.
** {{nbt|compound|state}}: The block state to use.
*** {{nbt inherit/block_state}}
*** {{nbt inherit/block_state}}
</div>
</div>


=== weighted_state_provider ===
=== weighted ===
Chooses a block state from a weighted list.
Chooses a block state from a weighted list.
<div class="treeview">
<div class="treeview">
* {{nbt|compound}}: A block state provider
* {{nbt|compound}}: A block state provider
** {{nbt|string|type}}: <code>weighted_state_provider</code>{{until|JE 26.3}} / <code>weighted</code>{{upcoming|JE 26.3}}
** {{nbt|string|type}}: <code>weighted</code>
** {{nbt|list|entries}}: (Cannot be empty) A weighted list of block state entries.
** {{nbt|list|entries}}: (Cannot be empty) A weighted list of block state entries.
*** {{nbt|compound}} A block state and its corresponding weight.
*** {{nbt|compound}} A block state and its corresponding weight.
Line 149: Line 151:
|{{HistoryLine||1.16.2|dev=20w28a|Block state providers now control the blocks placed by many [[Minecraft:configured feature]]s.{{Verify|This is where custom worldgen and configured features were added to data packs. Did block state providers exist even earlier?}}}}
|{{HistoryLine||1.16.2|dev=20w28a|Block state providers now control the blocks placed by many [[Minecraft:configured feature]]s.{{Verify|This is where custom worldgen and configured features were added to data packs. Did block state providers exist even earlier?}}}}
|{{HistoryLine||26.1|dev=snap11|All block state providers now support the {{cd|rule_based_state_provider}} type, which previously was only available for {{cd|disk}} features.}}
|{{HistoryLine||26.1|dev=snap11|All block state providers now support the {{cd|rule_based_state_provider}} type, which previously was only available for {{cd|disk}} features.}}
|{{HistoryLine|java upcoming}}
|{{HistoryLine||26.3|dev=snap2|Added the {{cd|copy_properties_provider}} block state provider.}}
|{{HistoryLine||26.3|dev=snap2|Added the {{cd|copy_properties_provider}} block state provider.}}
|{{HistoryLine|||dev=snap3|Added the {{cd|random_block_provider}} block state provider.
|{{HistoryLine|||dev=snap3|Added the {{cd|random_block_provider}} block state provider.
Line 161: Line 162:
{{Navbox Java Edition technical|datapack}}
{{Navbox Java Edition technical|datapack}}


[[Minecraft:de:Blockzustandsanbieter]]
[[Minecraft:fr:Génération du monde personnalisée/Fournisseur d'état de bloc]]
[[Minecraft:fr:Génération du monde personnalisée/Fournisseur d'état de bloc]]
[[Minecraft:ja:ブロック状態プロバイダー]]
[[Minecraft:ja:ブロック状態プロバイダー]]

Latest revision as of 11:08, 9 October 2026

Template:Exclusive A block state provider is used to provide a (potentially randomized) Minecraft:block and Minecraft:block state to be placed by Minecraft:configured features.

JSON format

Block state providers are defined using the following format:

Types

The following block state provider types exist.

copy_properties

Copies common block state properties from the block at the evaluated position to the resulting state.

dual_noise

Randomly chooses a block state according to two noise values.

noise

Randomly chooses a block state according to a noise value.

noise_threshold

Uses different block states when a noise value above or below the threshold.

random_block

Returns the default block state for a randomly chosen block.

randomized_int

Assigns a random value to an integer block property.

rotated

Randomly rotates any block with Template:Cd or Template:Cd properties.

rule_based

Provides a block state depending on the current block(s) by matching a sequence of rules.

<section begin="json format" />

simple

Specifies a single block state directly

weighted

Chooses a block state from a weighted list.

History

Template:Info needed section Template:HistoryTable

Navigation

Template:Navbox Java Edition technical

Minecraft:de:Blockzustandsanbieter Minecraft:fr:Génération du monde personnalisée/Fournisseur d'état de bloc Minecraft:ja:ブロック状態プロバイダー Minecraft:ko:블록 상태 제공자 Minecraft:pt:Geração de mundo personalizado/provedor de estado de bloco Minecraft:ru:Натуральные декорации/Провайдер состояний блока Minecraft:uk:Постачальник стану блока Minecraft:zh:方块状态提供器