# Item

**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, "slot")

//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, "slot")

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

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

* 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 `slot` param must be a string 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.
* The `amount` param must be a positive integer.

### Example

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

  event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
  .requireItem("cobblestone")
  .produceItem("3x minecraft:gravel")
  
})
```


---

# 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.21/mod-integrations/kubejs/recipes/item.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.
