Represents a predicate for a MCFluid.

This predicate will match a fluid state with either the given MCFluid or fluid tag (MCTag<T>), with the second check taking precedence over the first if they are both present. If this comparison succeeds, then the predicate may also verify additional fluid state properties via the supplied StatePropertiesPredicate.

By default, this predicate allows any fluid state to pass the checks without restrictions.

Импорт класса

It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.

import crafttweaker.api.predicate.FluidPredicate;

Extending AnyDefaultingVanillaWrappingPredicate

FluidPredicate extends AnyDefaultingVanillaWrappingPredicate. That means all methods available in AnyDefaultingVanillaWrappingPredicate are also available in FluidPredicate



Sets the fluid that this predicate should match.

If a tag to match against has already been set, then the tag check will take precedence over this check.

Return Type: FluidPredicate

FluidPredicate.withFluid(fluid as MCFluid) as FluidPredicate
fluidMCFluidThe fluid the predicate should match.


Sets the tag that this predicate should use for matching.

The predicate will successfully match only if the supplied fluid state's fluid is contained within the given tag.

Specifying both a tag and a fluid to match against will make the tag take precedence over the fluid.

Return Type: FluidPredicate

FluidPredicate.withFluidTag(fluidTag as MCTag<MCFluid>) as FluidPredicate
fluidTagMCTag<MCFluid>The tag the predicate should use for matching.


Creates and sets the StatePropertiesPredicate that will be matched against the fluid state's properties.

Any changes that have already been made to the state properties predicate will be overwritten, effectively replacing the previous one, if any.

Return Type: FluidPredicate

FluidPredicate.withStatePropertiesPredicate(builder as Consumer<StatePropertiesPredicate>) as FluidPredicate
конструкторConsumer<StatePropertiesPredicate>A consumer that will be used to configure the StatePropertiesPredicate.