Record Class BlockPredicate

java.lang.Object
java.lang.Record
net.minestom.server.instance.block.predicate.BlockPredicate
Record Components:
blocks - The block names/tags to match.
state - The block properties to match.
nbt - The block nbt to match.
All Implemented Interfaces:
Predicate<Block>

public record BlockPredicate(@Nullable RegistryTag<Block> blocks, @Nullable PropertiesPredicate state, @Nullable CompoundBinaryTag nbt, DataComponentPredicates components) extends Record implements Predicate<Block>

A predicate to filter blocks based on their name, properties, and/or nbt.

Note: Inline with vanilla, providing none of the filters will match any block.

Note: To match the vanilla behavior of comparing block NBT, the NBT predicate will ONLY match data which would be sent to the client eg with BlockHandler.getBlockEntityTags(). This is relevant because this structure is used for matching adventure mode blocks and must line up with client prediction.