Skip to content

Fluid Functions

Diogo B.Beloni edited this page Sep 16, 2026 · 1 revision

💧 Utility Functions for Fluid JSON

This module provides helper functions for creating JSON objects representing fluid inputs and fluid outputs in recipes or processes.

Quantity values are always specified in millibuckets (mb), where 1000mb = 1 bucket.

🔹 Fluid Inputs

  • fluidInput
    Creates a JSON object representing a fluid input.

    Example:

fluidInput("minecraft:lava", 1000)
// {
//   "type": "neoforge:single",
//   "amount": 1000,
//   "fluid": "minecraft:lava"
// }

In this example, it represents one bucket of lava.

🔹 Fluid Outputs

  • fluidOutput
    Creates a JSON object representing a fluid output.

    Example:

fluidOutput("minecraft:water", 500)
// {
//   "amount": 500,
//   "id": "minecraft:water"
// }

In this example, it represents half a bucket of water.

✅ Simple Usage Example

// Creating a hypothetical recipe with fluids
let fluidRecipe = {
  input: fluidInput("minecraft:lava", 1000),
  output: fluidOutput("minecraft:water", 1000)
};

console.log(fluidRecipe);
/*
{
  input: {
    "type": "neoforge:single",
    "amount": 1000,
    "fluid": "minecraft:lava"
  },
  output: {
    "amount": 1000,
    "id": "minecraft:water"
  }
}
*/

Clone this wiki locally