Minecraft:Block predicate
More actions
|
For the {{{Description}}} of the same name, see [[{{{Destination}}}]]. |
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:
- Template:Nbt: a block predicate<section begin="json format" />
- Template:Nbt: The type of the block predicate. See Template:Slink for options.
- additional fields depending on Template:Nbt. See Template:Slink.<section end="json format" />
Types
The following block predicate types exist:
all_of
Combined multiple block predicates. Matches if all specified block predicates match.
- Template:Nbt: a block predicate
- Template:Nbt:
all_of - Template:Nbt: (Can be empty) The child predicates.
- Template:Nbt: A block predicate.
- Template:Nbt:
any_of
Combined multiple block predicates. Matches if at least one of the specified block predicates matches.
- Template:Nbt: a block predicate
- Template:Nbt:
any_of - Template:Nbt: (Can be empty) The child predicates.
- Template:Nbt: A block predicate.
- Template:Nbt:
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: Value between -16 and 16 (inclusive).
- Template:Nbt: The direction of the block to check if it is sturdy.
- Template:Nbt:
height_range
Checks the height of the position against a given range.Template:Upcoming
- Template:Nbt: a block predicate
- Template:Nbt:
height_range - Template:Nbt: Vertical anchor describing the minimum height required.
- Template:Nbt: Vertical anchor describing the maximum height required.
- Template:Nbt:
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.
- Template:Nbt: Value between -16 and 16 (inclusive).
- Template:Nbt:
matching_block_tag
Checks if the block at the specified offset is in the given block tag.
- Template:Nbt: a block predicate
- Template:Nbt:
matching_block_tag - 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 block tag without
#to check for.
- Template:Nbt:
matching_blocks
Checks if the block at the specified offset is one of the specified blocks.
- Template:Nbt: a block predicate
- Template:Nbt:
matching_blocks - Template:Nbt: (optional, defaults to [0,0,0]) A list of 3 integers specifying an [X, Y, Z] block position offset to check.
- Template:NbtTemplate:Nbt: Template:Json ref that will match.
- Template:Nbt:
matching_fluids
Checks if the fluid at the specified offset is one of the specified fluid.
- Template:Nbt: a block predicate
- Template:Nbt:
matching_fluids - Template:Nbt: (optional, defaults to [0,0,0]) A list of 3 integers specifying an [X, Y, Z] block position offset to check.
- Template:NbtTemplate:Nbt: Template:Json ref that will match.
- Template:Nbt:
not
Inverts a given block predicate. Matches if the specified other block predicate does not match.
- Template:Nbt: a block predicate
- Template:Nbt:
not - Template:Nbt: The block predicate to invert.
- Template:Nbt:
replaceable
Checks if the block at the specified offset can be replaced by placing blocks.
- Template:Nbt: a block predicate
- Template:Nbt:
replaceable - 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: Value between -16 and 16 (inclusive).
- Template:Nbt:
solid
Checks if the block at the specified offset is solid.
- Template:Nbt: a block predicate
- Template:Nbt:
solid - 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: Value between -16 and 16 (inclusive).
- Template:Nbt:
true
Always matches, independent of the block.
- Template:Nbt: a block predicate
- Template:Nbt:
true
- Template:Nbt:
would_survive
Checks if a specified Minecraft:block state is a valid placement at the given offset.
- Template:Nbt: a block predicate
- Template:Nbt:
would_survive - 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: Value between -16 and 16 (inclusive).
- Template:Nbt: The blockstate to test.
- Template:Nbt:
History
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#方块谓词