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 146: Line 146:
{{Navbox Java Edition technical|datapack}}
{{Navbox Java Edition technical|datapack}}


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

Revision as of 11:04, 25 July 2026

Template:Exclusive

A block predicate 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.Template:Upcoming

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_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.

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#方块谓词