Class FluidAttributes

java.lang.Object
net.minecraftforge.fluids.FluidAttributes
Direct Known Subclasses:
FluidAttributes.Water

public class FluidAttributes extends Object
Minecraft Forge Fluid Implementation This class is a fluid (liquid or gas) equivalent to "Item." It describes the nature of a fluid and contains its general properties. These properties do not have inherent gameplay mechanics - they are provided so that mods may choose to take advantage of them. Fluid implementations are not required to actively use these properties, nor are objects interfacing with fluids required to make use of them, but it is encouraged. The default values can be used as a reference point for mods adding fluids such as oil or heavy water.
  • Field Details

    • BUCKET_VOLUME

      public static final int BUCKET_VOLUME
      See Also:
      Constant Field Values
    • translationKey

      private String translationKey
    • stillTexture

      private final ResourceLocation stillTexture
    • flowingTexture

      private final ResourceLocation flowingTexture
    • overlayTexture

      @Nullable private final ResourceLocation overlayTexture
    • fillSound

      private final SoundEvent fillSound
    • emptySound

      private final SoundEvent emptySound
    • luminosity

      private final int luminosity
      The light level emitted by this fluid. Default value is 0, as most fluids do not actively emit light.
    • density

      private final int density
      Density of the fluid - completely arbitrary; negative density indicates that the fluid is lighter than air. Default value is approximately the real-life density of water in kg/m^3.
    • temperature

      private final int temperature
      Temperature of the fluid - completely arbitrary; higher temperature indicates that the fluid is hotter than air. Default value is approximately the real-life room temperature of water in degrees Kelvin.
    • viscosity

      private final int viscosity
      Viscosity ("thickness") of the fluid - completely arbitrary; negative values are not permissible. Default value is approximately the real-life density of water in m/s^2 (x10^-3). Higher viscosity means that a fluid flows more slowly, like molasses. Lower viscosity means that a fluid flows more quickly, like helium.
    • isGaseous

      private final boolean isGaseous
      This indicates if the fluid is gaseous. Generally this is associated with negative density fluids.
    • rarity

      private final Rarity rarity
      The rarity of the fluid. Used primarily in tool tips.
    • color

      private final int color
      Color used by universal bucket and the ModelFluid baked model. Note that this int includes the alpha so converting this to RGB with alpha would be float r = ((color >> 16) & 0xFF) / 255f; // red float g = ((color >> 8) & 0xFF) / 255f; // green float b = ((color >> 0) & 0xFF) / 255f; // blue float a = ((color >> 24) & 0xFF) / 255f; // alpha
  • Constructor Details

  • Method Details