Interface BlockPredicate
- All Superinterfaces:
Wrapper
- All Known Subinterfaces:
AllOfPredicate, AnyOfPredicate, CombiningPredicate, HasSturdyFacePredicate, InsideWorldBoundsPredicate, MatchingBiomesPredicate, MatchingBlocksPredicate, MatchingBlockTagPredicate, MatchingFluidsPredicate, NotPredicate, ReplaceablePredicate, SolidPredicate, TrueBlockPredicate, WouldSurvivePredicate
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 placed features and various configured features.
- Since:
- 2.3.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic AllOfPredicate.BuilderallOf()Starts building anAllOfPredicate, which matches only when every child predicate matches.static TrueBlockPredicateReturns theTrueBlockPredicatesingleton, which always matches regardless of the block.static AnyOfPredicate.BuilderanyOf()Starts building anAnyOfPredicate, which matches when at least one child predicate matches.static BlockPredicateReads a Minecraft block predicate into a wrapper.Starts building aHasSturdyFacePredicate, which checks that the block at an offset has a full supporting surface on a given face.Starts building anInsideWorldBoundsPredicate, which checks that the position (with offset) is within the world's height limits.Starts building aMatchingBiomesPredicate, which checks that the biome at the block's position is one of the specified biomes.Starts building aMatchingBlocksPredicate, which checks that the block at an offset is one of the specified blocks.Starts building aMatchingBlockTagPredicate, which checks that the block at an offset is in the given block tag.static MatchingBlockTagPredicateCreates aMatchingBlockTagPredicatethat matches the block at the given offset.static MatchingBlockTagPredicatematchingBlockTag(Tag<Material> tag) Creates aMatchingBlockTagPredicatethat matches the block at the given offset.Starts building aMatchingFluidsPredicate, which checks that the fluid at an offset is one of the specified fluids.default NotPredicatenot()Negates this predicate.static NotPredicatenot(BlockPredicate predicate) Creates aNotPredicatethat inverts the given predicate.static ReplaceablePredicate.BuilderStarts building aReplaceablePredicate, which checks that the block at an offset can be replaced by placing blocks.static SolidPredicate.Buildersolid()Deprecated.Starts building aWouldSurvivePredicate, which checks that a block state would be a valid placement at the given offset.Methods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
Method Details
-
not
Negates this predicate.- Returns:
- the negated predicate
- Since:
- 3.0.0
-
allOf
Starts building anAllOfPredicate, which matches only when every child predicate matches.- Returns:
- a new
AllOfPredicate.Builder - Since:
- 3.0.0
- See Also:
-
anyOf
Starts building anAnyOfPredicate, which matches when at least one child predicate matches.- Returns:
- a new
AnyOfPredicate.Builder - Since:
- 3.0.0
- See Also:
-
hasSturdyFace
Starts building aHasSturdyFacePredicate, which checks that the block at an offset has a full supporting surface on a given face.- Returns:
- a new
HasSturdyFacePredicate.Builder - Since:
- 3.0.0
- See Also:
-
insideWorldBounds
Starts building anInsideWorldBoundsPredicate, which checks that the position (with offset) is within the world's height limits.- Returns:
- a new
InsideWorldBoundsPredicate.Builder - Since:
- 3.0.0
- See Also:
-
matchingBiomes
Starts building aMatchingBiomesPredicate, which checks that the biome at the block's position is one of the specified biomes.- Returns:
- a new
MatchingBiomesPredicate.Builder - Since:
- 3.0.0
- See Also:
-
matchingBlockTag
Starts building aMatchingBlockTagPredicate, which checks that the block at an offset is in the given block tag.- Returns:
- a new
MatchingBlockTagPredicate.Builder - Since:
- 3.0.0
- See Also:
-
matchingBlockTag
Creates aMatchingBlockTagPredicatethat matches the block at the given offset.- Parameters:
tag- the tag to match- Returns:
- the matching block tag predicate
- Since:
- 3.0.0
-
matchingBlockTag
Creates aMatchingBlockTagPredicatethat matches the block at the given offset.- Parameters:
tag- the tag to match- Returns:
- the matching block tag predicate
- Since:
- 3.0.0
-
matchingBlocks
Starts building aMatchingBlocksPredicate, which checks that the block at an offset is one of the specified blocks.- Returns:
- a new
MatchingBlocksPredicate.Builder - Since:
- 3.0.0
- See Also:
-
matchingFluids
Starts building aMatchingFluidsPredicate, which checks that the fluid at an offset is one of the specified fluids.- Returns:
- a new
MatchingFluidsPredicate.Builder - Since:
- 3.0.0
- See Also:
-
not
Creates aNotPredicatethat inverts the given predicate.- Parameters:
predicate- the predicate to invert- Returns:
- the negated predicate
- Since:
- 3.0.0
- See Also:
-
replaceable
Starts building aReplaceablePredicate, which checks that the block at an offset can be replaced by placing blocks.- Returns:
- a new
ReplaceablePredicate.Builder - Since:
- 3.0.0
- See Also:
-
solid
Deprecated.Deprecated in Minecraft in favor ofhasSturdyFace().Starts building aSolidPredicate, which checks that the block at an offset is solid.- Returns:
- a new
SolidPredicate.Builder - Since:
- 3.0.0
- See Also:
-
alwaysTrue
Returns theTrueBlockPredicatesingleton, which always matches regardless of the block.- Returns:
- the always-matching predicate
- Since:
- 3.0.0
- See Also:
-
wouldSurvive
Starts building aWouldSurvivePredicate, which checks that a block state would be a valid placement at the given offset.- Returns:
- a new
WouldSurvivePredicate.Builder - Since:
- 3.0.0
- See Also:
-
decode
Reads a Minecraft block predicate into a wrapper.- Parameters:
minecraftPredicate- the Minecraft predicate to read- Returns:
- the wrapper for the predicate
- Since:
- 3.3.0
-
hasSturdyFace().