CoreFluids. Each fluid is represented by a FluidDefinition record that bundles all NeoForge fluid objects together, and the underlying visual and chemical properties are held by a BaseFluid instance.
FluidDefinition
FluidDefinition is a record that aggregates all parts of a fluid registration.
Human-readable fluid name used for item/block registration.
Lazy supplier for the
FluidType (holds visual and chemical properties).The still/source fluid variant.
The flowing fluid variant.
The placed liquid block.
The bucket item for this fluid.
Getting a FluidStack
BaseFluid
BaseFluid extends NeoForge’s FluidType and implements IClientFluidExtensions. It holds all visual and chemical properties for a registered fluid.
Constructor
Properties
| Getter | Type | Description |
|---|---|---|
getTintColor() | int | ARGB tint applied to the fluid texture |
getFogColor() | Vector3f | RGB fog color when submerged |
isAcidic() | boolean | Whether the fluid is acidic |
isBasic() | boolean | Whether the fluid is basic/alkaline |
getTemp() | long | Temperature in Kelvin |
getStillTexture() | ResourceLocation | Texture for the still surface |
getFlowingTexture() | ResourceLocation | Texture for flowing surfaces |
getOverlayTexture() | ResourceLocation | Overlay texture when inside the fluid |
isAcidic, isBasic, and temp have corresponding setters.
CoreFluids registry methods
registerFluid() — short form
isAcidic and isBasic default to false; temp defaults to 298L K.
Display name used to derive registry IDs and bucket/block names.
ARGB integer tint color (e.g.
0xFFFF9933).RGB fog color shown when the player is submerged.
Chemical formula string registered with
CoreFormulas (e.g. "H₂SO₄"). Pass null or blank to skip formula registration.registerFluid() — full form
Mark the fluid as an acid.
Mark the fluid as a base/alkali.
Temperature in Kelvin.
getFluids()
FluidDefinition registered through CoreFluids.
getBaseFluid()
FluidType inside the given definition to BaseFluid. Returns null if the type is not a BaseFluid instance.
Formula integration
When a non-blankchemicalFormula is provided to registerFluid(), the mod automatically registers a Formula record for both the bucket item and the liquid block. The Formula record links an ItemLike to a formula string and can render a colored, italicized component:
Code example: registering a custom fluid
Call
registerFluid at mod initialization time, before FMLCommonSetupEvent fires. All registrations must happen during the DeferredRegister phase.