Block predicate

Helpers that build a minecraft:block_predicate object, one for each of its types. Where a field takes one, write the helper's call; its name is the type it makes. Click a type to see what it accepts.

AllOf

AllOf

Passes when every predicate passes.

AllOf(predicates)
predicates
list of BlockPredicate

AnyOf

AnyOf

Passes when any predicate passes.

AnyOf(predicates)
predicates
list of BlockPredicate

HasSturdyFace

HasSturdyFace

Passes when the block has a full face on one side.

HasSturdyFace(direction, offset?)
direction
Direction

The side to check.

offsetoptional
list of int -16..16 (exactly 3)

The block offset to check.

HeightRange

HeightRange
HeightRange(min_inclusive, max_inclusive)
min_inclusive
VerticalAnchor
max_inclusive
VerticalAnchor

InsideWorldBounds

InsideWorldBounds

Passes when the block is inside the world's height limits.

InsideWorldBounds(offset?)
offsetoptional
list of int -16..16 (exactly 3)

The block offset to check.

MatchingBiomes

MatchingBiomes

Passes when the block's biome is one of these.

MatchingBiomes(biomes)
biomes
biome id | #biome tag | list of biome ids

MatchingBlockTag

MatchingBlockTag

Passes when the block is in a block tag.

MatchingBlockTag(tag, offset?)
tag
block id | #block tag
offsetoptional
list of int -16..16 (exactly 3)

The block offset to check.

MatchingBlocks

MatchingBlocks

Passes when the block is one of these.

MatchingBlocks(blocks, offset?)
blocks
block id | #block tag | list of block ids

The blocks that pass.

offsetoptional
list of int -16..16 (exactly 3)

The block offset to check.

MatchingFluids

MatchingFluids

Passes when the fluid at the block is one of these.

MatchingFluids(fluids, offset?)
fluids
fluid id | #fluid tag | list of fluid ids
offsetoptional
list of int -16..16 (exactly 3)

The block offset to check.

Not

Not

Passes when predicate fails.

Not(predicate)
predicate
BlockPredicate

Replaceable

Replaceable

Passes when the block can be replaced, as air, water and grass can.

Replaceable()

Solid

Solid

Passes when the block is solid.

Solid()

True

True

Always passes.

True()

Unobstructed

Unobstructed

Passes when no entity is in the way of the block.

Unobstructed(offset?)
offsetoptional
list of int (exactly 3)

VolumeMatch

VolumeMatch
VolumeMatch(min, max, match)
min
list of int -16..16 (exactly 3)
max
list of int -16..16 (exactly 3)
match
BlockPredicate

WouldSurvive

WouldSurvive

Passes when a block would stay put here, as a sapling needs dirt below.

WouldSurvive(state, offset?)
state
BlockState

The block to test.

offsetoptional
list of int -16..16 (exactly 3)

The block offset to check.