> 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/recipes/requirements/item-transform.md).

# Item transform

Make an item be consumed then produced while keeping its data.

Item transform requirement combines both item input and output requirements.

It is used to consume an item, then produce another (or the same if needed).

The amounts of item consumed and produced are both customizable.

The input and output slots where the recipe will consume or produce items can be customized.

**By default the requirement will keep the nbt data of the input item and put it to the output item (can be disabled).**

The requirement type of item transform requirement is :  "`custommachinery:item_transform"`.

### Properties

The item transform requirement has 2 mandatory properties and 8 optional properties.

#### Mandatory properties

```json
"type": "custommachinery:item_transform" //Mandatory to define an item transform requirement.
```

<details>

<summary>Input</summary>

#### Name : `input`

#### Description :&#x20;

An ingredient with one of the following syntax :&#x20;

* For items

```json
"input": {
    "item": "item_id"
}
```

"item\_id" is the registry name of the item you want to be consumed by the recipe.

It must be specified like `namespace:item_registry_name` with "namespace" being either "minecraft" if the item is from vanilla or a mod ID if the item is from a mod (ex : `minecraft:diamond` or `mekanism:copper_ingot`).

* For tags

```json
"input": {
    "tag": "tag_id"
}
```

"tag\_id" is a tag grouping any item that can be consumed by the recipe.

#### Example :&#x20;

```json
"input": {
    "item": "minecraft:diamond"
}
```

The item consumed by the recipe will be a vanilla Diamond.

```json
"input": {
    "tag": "minecraft:logs"
}
```

The recipe will consume any logs.

</details>

#### Optional properties

<details>

<summary>Input amount</summary>

#### Name : `input_amount`

#### Description :&#x20;

A positive integer representing the amount of items consumed by the recipe.

#### Default : `1`

#### Example :&#x20;

```json
"input_amount": 3
```

The recipe will consume 3 items.

</details>

<details>

<summary>Input slots</summary>

#### Name : `input_slots`

#### Description :&#x20;

A string or array of strings representing the ID of the slot where the recipe will consume items.

The slot must be an input slot.

#### Default : `empty`

The items will be consumed from any input slots.

#### Example :&#x20;

```json
"input_slots": "input1"
```

The recipe will consume items only from the slot with id `input1`.

</details>

<details>

<summary>Output</summary>

#### Name : `output`

#### Description :&#x20;

An item id, which represent the item that will be produced by the recipe.

#### Default :&#x20;

If not specified, the produced item will be the same as the consumed item.

#### Example :&#x20;

```json
"output": "minecraft:diamond"
```

The recipe will produce a vanilla diamond.

</details>

<details>

<summary>Output amount</summary>

#### Name : `output_amount`

#### Description :&#x20;

A positive integer representing the amount of items produced by the recipe.

#### Default : `1`

#### Example :&#x20;

```json
"output_amount": 3
```

The recipe will produce 3 items.

</details>

<details>

<summary>Output slots</summary>

#### Name : `output_slots`

#### Description :&#x20;

A string or array of strings representing the ID of the slot where the recipe will produce items.

The slot must be an output slot.

#### Default : `empty`

The items will be produced to any output slots.

#### Example :&#x20;

```json
"output_slots": "output1"
```

The recipe will produce items only to the slot with id `output1`.

</details>

<details>

<summary>Copy nbt</summary>

#### Name : `copy_nbt`

#### Description :&#x20;

A boolean, representing whenever the produced item will have the same nbt as the consumed item, or not.

#### Default : `true`

The nbt data of the consumed item will be copied to the produced item.

#### Example :&#x20;

```json
"copy_nbt": false
```

The produced item will have no nbt data.

</details>

<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>

### Examples

A very simple item transform requirement that will consume a diorite to produce 2 andesite :&#x20;

```json5
{
    "type": "custommachinery:item_transform",
    "input": {
        "item": "minecraft:diorite"
    },
    "output": "minecraft:andesite",
    "output_amount": 2
}
```

An item transform requirement that transform a diamond pickaxe placed in a slot with id "input1" in a diamond shovel while keeping its nbt data, including damage and enchants, and place it in a slot with id "output1" :&#x20;

```json
{
    "type": "custommachinery:item_transform",
    "input": {
        "tag": "minecraft:diamond_pickaxe"
    },
    "input_slot": "input1",
    "output": "minecraft:diamond_shovel",
    "output_slot": "output1"
}
```
