# Fluid per tick

Fluid per tick requirement is used to define fluid inputs and outputs in a custom machine recipe.

To use it you need to provide the registry name and the amount (in mB, with 1000mB being 1 Bucket of fluid) of the fluid you want the recipe to consume/produce.

This requirement is available in both `input` and `output` modes.

In input mode : The machine will consume the desired amount of the specified fluid from the input tank it's in.

In output mode : The machine will produce the desired amount of the specified fluid and put it in the first disponible tank.

The requirement type of fluid per tick requirement is : `"custommachinery:fluid_per_tick".`

### Properties

The fluid per tick requirement have 4 mandatory properties and 2 optional properties.

#### Mandatory properties

```json
"type": "custommachinery:fluid_per_tick" //Mandatory to define a fluid per tick requirement.
```

<details>

<summary>Mode</summary>

#### Name : `mode`

#### Description :

Define the I/O mode of the requirement.

* `input` The requirement will consume fluid at the start of the crafting process.
* `output` The requirement will produce fluid at the end of the crafting process.

#### Example :

```json
"mode": "input"
```

The requirement will consume fluid at the start of the crafting process.

</details>

<details>

<summary>Fluid</summary>

#### Name : `fluid`

#### Description :&#x20;

The registry name of the fluid you want to be consumed/produced by the recipe.

It must be specified like `namespace:fluid_registry_name` with "namespace" being either "minecraft" if the fluid is from vanilla (only "minecraft:water" and "minecraft:lava") or a mod ID if the fluid is from a mod (ex : "mekanism:steam").

If the requirement mode is `input` you can use a tag here using the # prefix like `#minecraft:water`.&#x20;

**If the requirement mode is output you can't use a tag, only fluids are allowed !**

#### Example :&#x20;

```json
"fluid": "minecraft:lava"
```

The fluid consumed/produced by the recipe will be vanilla lava.

```json
"fluid": "#minecraft:water"
```

The recipe will accept any fluid that are in the `minecraft:water` tag.

</details>

<details>

<summary>Amount</summary>

#### Name : amount

#### Description :&#x20;

A positive integer that define the amount of the specified fluid you want to be consumed/produced.&#x20;

It can be any positive number but remember that the machine need enough tank capacity to input/output the fluid.

#### Example :&#x20;

```json
"amount": 1000
```

The recipe will consume/produce 1000mB of the specified fluid.

</details>

#### Optional properties

<details>

<summary>Chance</summary>

#### Name : `chance`

#### Description :

A double between 0.0 and 1.0 that define the chance of the requirement to be processed.

#### Default : 1

The requirement will always be processed.

#### Example :

```json
"chance": 0.7
```

The requirement will have 70% chance to be processed.

</details>

<details>

<summary>Tank</summary>

#### Name : `tank`

#### Description :&#x20;

The tank id of a tank you want to force the player to put the fluid in. The tank id **must be exactly the same** as the one specified in the [Fluid Component ID property](https://frinn.gitbook.io/custom-machinery-1.16/creating-custom-machines/machine-components/fluid-component#mandatory-properties) or it will not work. If the requirement mode is "output" the produced fluid will be put in the specified tank.

#### Default : `empty`

The fluid can be put in any tank.

#### Example :&#x20;

```json
"tank": "input1"
```

The fluid will be input/output only in the tank with id `input1`.

</details>

### Example

A fluid requirement that will make the custom machine recipe consume 20mB of water with 50% chance :

```json
{
    "type": "custommachinery:fluid_per_tick",
    "mode": "input",
    "fluid": "minecraft:water",
    "amount": 20,
    "chance": 0.5
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://frinn.gitbook.io/custom-machinery-1.16/recipes/requirements/fluid-per-tick.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
