Command

Use the command requirement in a KubeJS recipe

Use one of these methods to add a Command Requirement to the recipe.

.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

ServerEvents.recipes(event => {

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