> 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.md).

# Item

Use the item requirement in a KubeJS recipe

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

```javascript
.requireItem(item)
.requireItem(item, "slot")

.requireItemTag("tag")
.requireItemTag("tag", amount)
.requireItemTag("tag", amount, nbt)
.requireItemTag("tag", amount, "slot")
.requireItemTag("tag", amount, nbt, "slot")

.produceItem(item)
.produceItem(item, "slot")
```

* The `item` param must be created using `Item.of()` KubeJS method. \
  Example : `Item.of("minecraft:diamond", 42)`
* The `slot` param 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.
* The `tag` param must be a string starting with # defining a valid tag id. \
  Example : `"#forge:stone"`
* The `amount` param must be a positive integer.
* The `nbt` param must be a map. \
  Example: `{nbt1: 1, nbt2: "something"}`.

### Example

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

  event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
  .requireItem(Item.of("minecraft:cobblestone"))
  .produceItem(Item.of("minecraft:gravel", 1))
  
})
```
