# Chemical (Mekanism)

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

**Use one of these methods to add a** [**Chemical Requirement**](/custom-machinery-1.19/recipes/requirements/chemical-mekanism.md) **to the recipe.**

#### Gas :&#x20;

```javascript
.requireGas(gas)
.requireGas(gas, "tankID")

.requireGasPerTick(gas)
.requireGasPerTick(gas, "tankID")

.produceGas(gas)
.produceGas(gas, "tankID")

.produceGasPerTick(gas)
.produceGasPerTick(gas, "tankID")
```

#### Infusion :&#x20;

```javascript
.requireInfusion(infusion)
.requireInfusion(infusion, "tankID")

.requireInfusionPerTick(infusion)
.requireInfusionPerTick(infusion, "tankID")

.produceInfusion(infusion)
.produceInfusion(infusion, "tankID")

.produceInfusionPerTick(infusion)
.produceInfusionPerTick(infusion, "tankID")
```

#### Pigment :&#x20;

```javascript
.requirePigment(pigment)
.requirePigment(pigment, "tankID")

.requirePigmentPerTick(pigment)
.requirePigmentPerTick(pigment, "tankID")

.producePigment(pigment)
.producePigment(pigment, "tankID")

.producePigmentPerTick(pigment)
.producePigmentPerTick(pigment, "tankID")
```

#### Slurry

```javascript
.requireSlurry(slurry)
.requireSlurry(slurry, "tankID")

.requireSlurryPerTick(slurry)
.requireSlurryPerTick(slurry, "tankID")

.produceSlurry(slurry)
.produceSlurry(slurry, "tankID")

.produceSlurryPerTick(slurry)
.produceSlurryPerTick(slurry, "tankID")
```

* The `gas`, `infusion`, `pigment` and `slurry` params must be the ID of the chemical: `"namespace:id"` example : `"mekanism:sulfuric_acid"` \
  You can also specify an amount (in mB) : `"mekanism:sulfuric_acid 500"` \
  If no amount is specified the default is 1000mB.
* The `tank` param must be a string corresponding to a tank id defined in a custom machine json [Chemical Component](/custom-machinery-1.19/creating-custom-machines/machine-components/chemical-component-mekanism.md) `tank` property.

### Example

This recipe will consume 1000mB of steam gas to produce 100mB of white pigment :&#x20;

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

  event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
  .requireGas("mekanism:steam 1000")
  .producePigment("mekanism:white 100")
})
```


---

# 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.19/mod-integrations/kubejs/recipes/chemical-mekanism.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.
