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

# Command

Use the command requirement in a KubeJS recipe

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

```javascript
.runCommandOnStart("command")
.runCommandOnStart("command", permissionLevel)
.runCommandOnStart("command", log)
.runCommandOnStart("command", permissionLevel, log)

.runCommandEachTick("command")
.runCommandEachTick("command", permissionLevel)
.runCommandEachTick("command", log)
.runCommandEachTick("command", permissionLevel, log)

.runCommandOnEnd("command")
.runCommandOnEnd("command", permissionLevel)
.runCommandOnEnd("command", log)
.runCommandOnEnd("command", permissionLevel, log)
```

* The `command` param must be a string starting by `/` which will be run as a command.
* The `permissionLevel` param must be a positive integer. \
  Default : `2`
* The `log` param must be a boolean, if true the command will be logged in admin chat as a system command. \
  Default : `false`

### Example

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

  event.recipes.custommachinery.custom_machine("custommachinery:power_crusher", 100)
  .runCommandOnEnd("/time set 0")
  
})
```
