Class EntityFluidInteractionRegistry
java.lang.Object
net.fabricmc.fabric.api.registry.fluid.EntityFluidInteractionRegistry
A registry for fluid tags, that should be tracked by
Entity's EntityFluidInteraction.-
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid>> Returns a collection of registered fluid tags with custom behavior.static @Nullable FluidBehaviorgetFluidBehavior(net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid> fluid) Returns the custom registered fluid behavior.static voidregister(net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid> fluid, FluidBehavior behavior) Registers a tracked fluid tag.
-
Method Details
-
register
public static void register(net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid> fluid, FluidBehavior behavior) Registers a tracked fluid tag.- Parameters:
fluid- tag representing a fluid type that should be tracked.behavior- an instance defining the behavior of the fluid
-
getFluidBehavior
public static @Nullable FluidBehavior getFluidBehavior(net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid> fluid) Returns the custom registered fluid behavior.- Parameters:
fluid- tag representing a fluid type- Returns:
- connected fluid behavior instance or null if not set
-
getCustomInteractableFluids
public static Collection<net.minecraft.tags.TagKey<net.minecraft.world.level.material.Fluid>> getCustomInteractableFluids()Returns a collection of registered fluid tags with custom behavior.- Returns:
- a collection of fluid tags
-