Class EntityFluidInteractionRegistry

java.lang.Object
net.fabricmc.fabric.api.registry.fluid.EntityFluidInteractionRegistry

@Experimental public final class EntityFluidInteractionRegistry extends Object
A registry for fluid tags, that should be tracked by Entity's EntityFluidInteraction.
  • 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