> 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/loot-table.md).

# Loot table

Use the loot table requirement in a KubeJS recipe

**Use one of these methods to add a** [**Loot Table Requirement**](https://github.com/Frinn38/Custom-Machinery/wiki/Loot-Table-Requirement) **to the recipe.**

```javascript
.lootTableOutput("loot_table")

.lootTableOutput("loot_table", luck)
```

* The `loot_table` param must be a string path that point to a loot table. The loot table file must be loaded with a datapack or a loader mod.\
  Example: `custommachinery:my_test_loottable` point to a file in `data/custommachinery/loot_tables/my_test_loottable.json`
* The `luck` param must be a float. Default is 0.0 and it can be used in the loot table to alter the quantity of generated items.

### Example

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

  event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
  .lootTableOutput("custommachinery:my_test_loottable")
  
})
```
