> 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/mod-integrations/kubejs/recipes/item-transform.md).

# Item transform

Use the item transform requirement in a KubeJS recipe

**Use one of these methods to add an** [**Item transform requirement**](#item-1) **to the recipe.**

```javascript
.transformItem(ItemStackJS input)
.transformItem(ItemStackJS input, ItemStackJS output)
.transformItem(ItemStackJS input, ItemStackJS output, String inputSlot, String outputSlot)
.transformItem(ItemStackJS input, ItemStackJS output, String inputSlot, String outputSlot, nbt => {return nbt;})

.transformItemTag(String tag)
.transformItemTag(String tag, int inputAmount, CompoundTag inputNBT)
.transformItemTag(String tag, int inputAmount, CompoundTag inputNBT, ItemStackJS output)
.transformItemTag(String tag, int inputAmount, CompoundTag inputNBT, ItemStackJS output, String inputSlot, String outputSlot)
.transformItemTag(String tag, int inputAmount, CompoundTag inputNBT, ItemStackJS output, String inputSlot, String outputSlot, nbt => {return nbt;})
```

* The `input and output`params must be an ItemStackJS, created using `Item.of()` KubeJS method. \
  Example : `Item.of("minecraft:diamond", 42)`
* The `inputSlot` and `outputSlot` params must be a string corresponding to a slot id defined in a custom machine json [Item Component](/custom-machinery-1.19/creating-custom-machines/machine-components/item-component.md) `slot` property.\
  It is optional and the default value is `""` (no specific slot required).
* The `tag` param must be a string starting with # defining a valid tag id. \
  Example : `"#forge:stone"`
* The `inputAmount` param must be a positive integer.
* The `inputNBT` param must be a map. \
  Example: `{nbt1: 1, nbt2: "something"}`.
* The last param can be a function that takes a map which is the nbt of the input item (the map will be empty if the item doesn't have nbt data), and must return a map which will be set as the nbt of the output item.

### Example

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

  event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
  .transformItem(Item.of("minecraft:stone"))
  
})
```
