> For the complete documentation index, see [llms.txt](https://frinn.gitbook.io/custom-machinery-1.21/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://frinn.gitbook.io/custom-machinery-1.21/mod-integrations/kubejs/recipes/fluid.md).

# Fluid

Use the fluid requirement in a KubeJS recipe

**Use one of these methods to add a** [**Fluid Requirement**](/custom-machinery-1.21/recipes/requirements/fluid.md) **to the recipe.**

```javascript
//Once-per-recipe methods
.requireFluid(ingredient)
.requireFluid(ingredient, tanks)

.produceFluid(fluid)
.produceFluid(fluid, tanks)

//Per-tick methods
.requireFluidPerTick(ingredient)
.requireFluidPerTick(ingredient, tanks)

.produceFluidPerTick(fluid)
.produceFluidPerTick(fluid, tanks)
```

* The `ingredient` param must be a SizedFluidIngredient created using one of the following syntax:&#x20;
  * String syntax : `"water"` or `"mekanism:steam"` or `"1000x water"`
  * Tag string syntax : `#water` or `"100x #water"`
  * &#x20;`Fluid.of()` KubeJS method : `Fluid.of("mekanism:steam", 42)`
* The `tanks` param must be a string or array of strings corresponding to a tank id defined in a custom machine json [Fluid Component](/custom-machinery-1.21/creating-custom-machines/machine-components/fluid-component.md) `tank` property. If omitted, the recipe will  input/output from/to any available tank.

### Example

```javascript
ServerEvents.recipes(event => {

  event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
  .requireFluid("1000x water", "input1")
  .produceFluid("500x lava", ["output1", "output2"]
  
})
```
