> 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/working-core.md).

# Working core

**Use one of these methods to add a** [**working core requirement**](/custom-machinery-1.21/recipes/requirements/working-core.md) **to the recipe.**

```javascript
//Require any recipe to be running on any core
.requireWorkingCore()

//Require a specific recipe to be running on any core
.requireWorkingCore("recipe")

//Require any recipe to be running on a specific core
.requireWorkingCore(core)

//Require a specific recipe to be running on a specific core
.requireWorkingCore(core, recipe)
```

* The `core`param must be an integer between 1 and the max amount of cores defined in the [machine processor](/custom-machinery-1.21/creating-custom-machines/processor/machine.md) `amount` property.
* The `recipe` param must be a recipe id.

Note : when creating recipes with KubeJS their ids might change when the script is modified. To be sure the recipe id will never change you can appends `.id("some_recipe_id")` after the recipe.

### Example

The following recipe will only run if the core with id 1 is processing the recipe with id "kubejs:test\_recipe" :&#x20;

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

  event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
  .requireWorkingCore(1, "kubejs:test_recipe")
  
})
```
