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 predicate: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Sync: updated from Minecraft
SyncBot (talk | contribs)
Sync: updated from Minecraft
Line 60: Line 60:
** {{nbt|list|offset}}: (optional, defaults to [0,0,0]) A list of 3 integers specifying an [X, Y, Z] block position offset to check.
** {{nbt|list|offset}}: (optional, defaults to [0,0,0]) A list of 3 integers specifying an [X, Y, Z] block position offset to check.
*** {{nbt|int}}: Value between -16 and 16 (inclusive).
*** {{nbt|int}}: Value between -16 and 16 (inclusive).
</div>
=== matching_biomes ===
Checks if the biome at the position is one of the specified biomes.
<div class="treeview">
* {{nbt|compound}}: a block predicate
** {{nbt|string|type}}: <code>matching_biomes</code>
** {{nbt|string}}{{nbt|list|biomes}}: {{json_ref|biome|tag=1|tag_link=biome tag (Java Edition)}} that will match.
</div>
</div>


Line 122: Line 130:
* {{nbt|compound}}: a block predicate
* {{nbt|compound}}: a block predicate
** {{nbt|string|type}}: <code>true</code>
** {{nbt|string|type}}: <code>true</code>
</div>
=== unobstructed ===
Checks if the position (with the specified offset) is unobstructed (no block collision).
<div class="treeview">
* {{nbt|compound}}: a block predicate
** {{nbt|string|type}}: <code>unobstructed</code>
** {{nbt|list|offset}}: (optional, defaults to [0,0,0]) A list of 3 integers specifying an [X, Y, Z] block position offset to check.
</div>
=== volume_match ===
Checks that every block within a volume, defined by minimum and maximum offsets, matches the given block predicate.
<div class="treeview">
* {{nbt|compound}}: a block predicate
** {{nbt|string|type}}: <code>volume_match</code>
** {{nbt|list|min}}: A list of 3 integers specifying the minimum [X, Y, Z] offset of the volume.
*** {{nbt|int}}: Value between -16 and 16 (inclusive).
** {{nbt|list|max}}: A list of 3 integers specifying the maximum [X, Y, Z] offset of the volume.
*** {{nbt|int}}: Value between -16 and 16 (inclusive).
** {{nbt|compound|match}}: The block predicate that must match at every position in the volume.
</div>
</div>



Revision as of 11:06, 28 September 2026

Template:Exclusive

A block predicate (also known as a placement condition) is a test for the state of a block at a given position in the world. They are used by placement modifiers in Minecraft:placed features, numerous Minecraft:configured features, and enchantments.

JSON Format

Block predicates are defined using the following format:

Types

The following block predicate types exist:

all_of

Combined multiple block predicates. Matches if all specified block predicates match.

any_of

Combined multiple block predicates. Matches if at least one of the specified block predicates matches.

has_sturdy_face

Checks if the block at the specified offset has a full block supporting surface in the specified direction.

  • Template:Nbt: a block predicate
    • Template:Nbt: has_sturdy_face
    • Template:Nbt: (optional, defaults to [0,0,0]) A list of 3 integers specifying an [X, Y, Z] block position offset to check.
    • Template:Nbt: The direction of the block to check if it is sturdy.

height_range

Checks the height of the position against a given range.

inside_world_bounds

Checks if the positions y-level (with specified offset) is within the height limits of the world.

  • Template:Nbt: a block predicate
    • Template:Nbt: inside_world_bounds
    • Template:Nbt: (optional, defaults to [0,0,0]) A list of 3 integers specifying an [X, Y, Z] block position offset to check.

matching_biomes

Checks if the biome at the position is one of the specified biomes.

matching_block_tag

Checks if the block at the specified offset is in the given block tag.

matching_blocks

Checks if the block at the specified offset is one of the specified blocks.

matching_fluids

Checks if the fluid at the specified offset is one of the specified fluid.

not

Inverts a given block predicate. Matches if the specified other block predicate does not match.

replaceable

Checks if the block at the specified offset can be replaced by placing blocks.

solid

Checks if the block at the specified offset is solid.

true

Always matches, independent of the block.

unobstructed

Checks if the position (with the specified offset) is unobstructed (no block collision).

  • Template:Nbt: a block predicate
    • Template:Nbt: unobstructed
    • Template:Nbt: (optional, defaults to [0,0,0]) A list of 3 integers specifying an [X, Y, Z] block position offset to check.

volume_match

Checks that every block within a volume, defined by minimum and maximum offsets, matches the given block predicate.

  • Template:Nbt: a block predicate
    • Template:Nbt: volume_match
    • Template:Nbt: A list of 3 integers specifying the minimum [X, Y, Z] offset of the volume.
    • Template:Nbt: A list of 3 integers specifying the maximum [X, Y, Z] offset of the volume.
    • Template:Nbt: The block predicate that must match at every position in the volume.

would_survive

Checks if a specified Minecraft:block state is a valid placement at the given offset.

History

Template:Info needed section Template:HistoryTable

Navigation

Template:Navbox Java Edition technical

Minecraft:de:Block-Prädikate Minecraft:fr:Génération du monde personnalisée/Prédicat de bloc Minecraft:ja:ワールド生成のカスタマイズ/block predicate Minecraft:pt:Geração de mundo personalizado/predicado de bloco Minecraft:zh:编码格式/Worldgen#方块谓词