> For the complete documentation index, see [llms.txt](https://frinn.gitbook.io/custom-machinery-1.19/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.19/creating-custom-machines/machine-components/chemical-component-mekanism.md).

# Chemical component (Mekanism)

Add chemical tanks inside the machine.

{% hint style="warning" %}
This component requires [Custom Machinery Mekanism](https://www.curseforge.com/minecraft/mc-mods/custom-machinery-mekanism) to be installed.
{% endhint %}

This components is used to make the machine able to hold Mekanism chemicals.

It is compatible with Mekanism pressurized pipes and any other mods that use the same system.

Basically adding this component to the machine json will add a chemical tank to the machine.

{% hint style="info" %}
You can add as much as you want chemical components to your machine.

Each component will act as a separate chemical tank.
{% endhint %}

#### All of Mekanism chemicals types are supported :&#x20;

* Gas
* Infusion
* Pigment
* Slurry

A chemical component can only hold a specific type of chemical (gas OR infusion OR pigment OR slurry). The type of chemical is defined in the `type` property (see below).

### Properties

The chemical component has 3 mandatory properties and 7 optional properties :&#x20;

#### Mandatory properties

```json5
"type": "custommachinery:gas" //Mandatory to define a gas chemical component.
OR
"type": "custommachinery:infusion" //Mandatory to define an infusion chemical component.
OR
"type": "custommachinery:pigment" //Mandatory to define a pigment chemical component.
OR
"type": "custommachinery:slurry" //Mandatory to define a slurry chemical component.
```

<details>

<summary>Capacity</summary>

#### Name : `capacity`

#### Description :&#x20;

A positive integer value that define the amount of chemical that can be stored in the tank (Volume in Forge mB, with 1000mB being 1 Bucket)

#### Example :&#x20;

```json5
"capacity": 10000 //This component will be able to store 10000mB.
```

</details>

<details>

<summary>Id</summary>

#### Name : `id`

#### Desccription :&#x20;

A string that define the id of the tank (used in the gui element and recipes), the String must be all lowercase with letters and numbers only (no spaces or special characters).

#### Example :&#x20;

```json5
"id": "tank1"
```

</details>

#### Optional properties

<details>

<summary>Max input</summary>

#### Name : `maxInput`

#### Description :&#x20;

A positive integer that represent the max mB that can be input in the tank during a single tick.

#### Default :&#x20;

The `capacity` of the tank.

#### Example :&#x20;

```json5
"maxInput": 1000 //The machine can accept 1000mB/tick.
```

</details>

<details>

<summary>Max output</summary>

#### Name : `maxOutput`

#### Description :&#x20;

A positive integer that represent the max mB that can be output from the tank during a single tick.

#### Default :&#x20;

The `capacity` of the tank.

#### Example :&#x20;

```json5
"maxOutput": 1000 //The machine can give 1000mB/tick.
```

</details>

<details>

<summary>Filter</summary>

#### Name : `filter`

#### Description :&#x20;

A blacklist of chemicals that the tank can't accept.&#x20;

The chemicals must be referenced by their registry name like `mekanism:sulfuric_acid` .&#x20;

By default the blacklist is empty so all chemicals are accepted.

#### Default :&#x20;

No filter, so all chemicals are accepted by the tank.

#### Example :&#x20;

```json5
"filter": "mekanism:steam" //The tank will accept all chemicals except mek steam.
```

</details>

<details>

<summary>Whitelist</summary>

#### Name : `whitelist`

#### Description :&#x20;

A boolean, if true the filter property will act as a whitelist instead of a blacklist, meaning that only chemicals specified in the whitelist will be accepted by the tank.

#### Default : `false`

The filter property is a blacklist.

#### Example :&#x20;

```json5
"whitelist": true //The filter property is a whitelist.
```

</details>

<details>

<summary>Mode</summary>

#### Name : `mode`

#### Description :&#x20;

The IO mode of the tank, used only by recipes to know which tanks are inputs and outputs.

Available modes are (input/output/both/none).&#x20;

While crafting the machine will search for chemicals to consume in input tanks and put the recipe results in the output tanks.

For changing I/O mode of a tank for external interaction, such as buckets and pipes see the [Config](/custom-machinery-1.19/misc/config.md) property below.

#### Default : `both`

#### Example :&#x20;

```json5
"mode": "input" //Set the tank as an input tank.
```

</details>

{% content-ref url="/pages/qhkQG0LIzUQkB48hMiYA" %}
[Config](/custom-machinery-1.19/misc/config.md)
{% endcontent-ref %}

<details>

<summary>Unique</summary>

#### Name : `unique`

#### Description :&#x20;

A boolean property (true/false) that define if the chemical component can accept a chemical that is already in another chemical component in the same machine.

If the component is set as "unique" a player won't be able to insert a chemical that is already in another tank, even if that tank is full (basically prevent overfill).

#### Default : `false`

The chemical component won't care if the fluid is already in another tank.

#### Example :&#x20;

The chemical component won't accept chemical that already are in another component.

```json
"unique": true
```

</details>

### Example

An example of gas chemical component that can store 10000mB of sulfuric acid only, send 1000mB/tick and receive 666mB/tick.

```json5
{
    "type": "custommachinery:gas",
    "capacity": 10000,
    "id": "tank1",
    "maxInput": 666,
    "maxOutput": 1000,
    "filter": "mekanism:sulfuric_acid",
    "whitelist": true
}
```
