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

# Item

Use the item requirement in a KubeJS recipe

**Use one of these methods to add an** [**Item Requirement**](/custom-machinery-1.21/recipes/requirements/item.md) **to the recipe.**

```javascript
.requireItem(ingredient)
.requireItem(ingredient, slots)

//Same as 'requireItem' but the item will be consumed at the end of the crafting process.
//Removing the items during process will cause the machine to stop and wait for them to be put again.
.requireItemOnEnd(ingredient)
.requireItemOnEnd(ingredient, slots)

//Only check if a slot is empty
.requireEmptyItem()
.requireEmptyItem(slots)

.produceItem(item)
.produceItem(item, slots)
```

* The `ingredient` param must be an ItemStack created using one of the following syntax:&#x20;
  * String syntax : `"diamond"` or `"botania:pure_daisy"` or `"4x mekanism:osmium_ingot"`
  * Tag string syntax : `"#c:stones"` or `"4x #c:stones"`
  * &#x20;`Item.of()` KubeJS method : `Item.of("minecraft:diamond", 42)`
* The `slots` param must be a string or array of strings corresponding to a slot id defined in a custom machine json [Item Component](/custom-machinery-1.21/creating-custom-machines/machine-components/item-component.md) `slot` property. If omitted the recipe will  input/output from/to any available slot.
* The `amount` param must be a positive integer.

### Example

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

  event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
  .requireItem("cobblestone", "input1")
  .requireItem("flint")
  .produceItem("3x minecraft:gravel", ["output1", "output2"])
  
})
```
