Minecraft:Block state provider: Difference between revisions
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| (3 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 === | ||
Copies common block state properties from the block at the evaluated position to the resulting state. | 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> | ** {{nbt|string|type}}: <code>copy_properties</code> | ||
** {{ | ** {{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 === | ||
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}}: | ** {{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 === | ||
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}}: | ** {{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 === | ||
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}}: | ** {{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 === | ||
Returns the default block state for a randomly chosen block. | 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}}: | ** {{nbt|string|type}}: <code>random_block</code> | ||
** {{nbt|string}}{{nbt|compound}}{{nbt|list|blocks}}: {{json ref|block|tag=1|inline=1}}; Cannot be empty — Blocks to choose from. | ** {{nbt|string}}{{nbt|compound}}{{nbt|list|blocks}}: {{json ref|block|tag=1|inline=1}}; Cannot be empty — Blocks to choose from. | ||
*** {{nbt inherit/block_state}} | *** {{nbt inherit/block_state}} | ||
</div> | </div> | ||
=== | === 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}}: | ** {{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 === | ||
Randomly rotates | 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}}: | ** {{nbt|string|type}}: <code>rotated</code> | ||
** {{nbt|compound|state}}: | ** {{nbt|compound|state}}: A block state provider | ||
** {{nbt|compound|direction | ** {{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 === | ||
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}}: | ** {{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 === | ||
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}}: | ** {{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 === | ||
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}}: | ** {{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 160: | 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:
- Template:Nbt: A block state provider<section begin="json format" />
- Template:Nbt: The type of the block state provider, see Template:Slink for option.
- Additional fields based on Template:Nbt, see Template:Slink.<section end="json 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.
- Template:Nbt: A block state provider
- Template:Nbt:
copy_properties - Template:Nbt: 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
- Template:Nbt: block id
- Template:Nbt: block properties
- Template:Nbt:
dual_noise
Randomly chooses a block state according to two noise values.
- Template:Nbt: A block state provider
- Template:Nbt:
dual_noise - Template:Nbt: The seed of the noise.
- Template:Nbt: A noise.
- Template:Nbt: Horizontal scale of noise. Must be a positive value.
- Template:Nbt: The noise used for the first selection.
- Template:Nbt: Horizontal scale of the slow noise. Must be a positive value.
- Template:Nbt: The number of block states that selected out by slow noise.
- Template:Nbt: The min number of block states after selection by slow noise. Must be an integer equal to or greater than 1.
- Template:Nbt: The max number of block states after selection by slow noise. Must be an integer equal to or less than 64, and must be greater than Template:Nbt.
- Template:Nbt: Shorthand version of Template:Nbt.
- Template:Nbt: Min number. Must be an integer equal to or greater than 1.
- Template:Nbt: Max number. Must be an integer equal to or less than 64, and must be greater than the min number.
- Template:Nbt: Shorthand version of Template:Nbt when the min equals to the max. Value between 1 and 64 (both inclusive).
- Template:Nbt: List of block states to choose from.
- Template:Nbt: A block state.
- Template:Nbt:
noise
Randomly chooses a block state according to a noise value.
- Template:Nbt: A block state provider
- Template:Nbt:
noise - Template:Nbt: The seed of the noise.
- Template:Nbt: A noise.
- Template:Nbt: Horizontal scale of the noise. Must be a positive value.
- Template:Nbt: (Cannot be empty) List of optional block states.
- Template:Nbt: A block state.
- Template:Nbt:
noise_threshold
Uses different block states when a noise value above or below the threshold.
- Template:Nbt: A block state provider
- Template:Nbt:
noise_threshold - Template:Nbt: The seed of the noise.
- Template:Nbt: A noise.
- Template:Nbt: Horizontal scale of noise. Must be a positive value.
- Template:Nbt: Value between -1.0 and 1.0 (inclusive). The threshold of the noise value. If the noise value is lower than this value, the block states in Template:Cd will be selected.
- Template:Nbt: Value between 0.0 and 1.0 (inclusive). If the noise value is higher than the threshold, the block states in Template:Cd will be selected with a probability of high_chance.
- Template:Nbt: Default block state. These block states is used when the noise value is higher than Template:Cd but high_states is not selected according to high_chance.
- Template:Nbt: (Cannot be empty) List of block states to choose from when lower than threshold.
- Template:Nbt: A block state.
- Template:Nbt: (Cannot be empty) List of block states to choose from when higher than threshold.
- Template:Nbt: A block state.
- Template:Nbt:
random_block
Returns the default block state for a randomly chosen block.
- Template:Nbt: A block state provider
- Template:Nbt:
random_block - Template:NbtTemplate:NbtTemplate:Nbt: Template:Json ref; Cannot be empty — Blocks to choose from.
- Template:Nbt:
randomized_int
Assigns a random value to an integer block property.
- Template:Nbt: A block state provider
- Template:Nbt:
randomized_int - Template:Nbt: The name of a block property.
- Template:NbtTemplate:Nbt: The value of the block property.
- Template:Nbt: Another block state provider that specifies the source of the block state.
- Template:Nbt:
rotated
Randomly rotates any block with Template:Cd or Template:Cd properties.
- Template:Nbt: A block state provider
- Template:Nbt:
rotated - Template:Nbt: A block state provider
- Template:Nbt: Optional. Describes the direction to set. If omitted, a random direction is chosen.
- Template:Nbt:
rule_based
Provides a block state depending on the current block(s) by matching a sequence of rules.
- Template:Nbt: A block state provider
- Template:Nbt:
rule_based - Template:Nbt 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.
- Template:Nbt (Required, but can be empty) Rules of the block to use.
- Template:Nbt One rule.
- Template:Nbt The Minecraft:block predicate of this rule.
- Template:Nbt The block to use when the predicate is passed.
- Template:Nbt inherit/block state provider<section end="json format" />
- Template:Nbt One rule.
- Template:Nbt:
simple
Specifies a single block state directly
- Template:Nbt: A block state provider
- Template:Nbt:
simple - Template:Nbt: The block state to use.
- Template:Nbt:
weighted
Chooses a block state from a weighted list.
- Template:Nbt: A block state provider
- Template:Nbt:
weighted - Template:Nbt: (Cannot be empty) A weighted list of block state entries.
- Template:Nbt A block state and its corresponding weight.
- Template:Nbt: The block state to use.
- Template:Nbt: The weight of this entry.
- Template:Nbt A block state and its corresponding weight.
- Template:Nbt:
History
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:方块状态提供器