Command
Make the recipe process a command
Command requirement is used to make the custom machine execute commands while crafting.
This requirement doesn't have a mode and will not stop the processing of a recipe even if the command fail.
The command can be executed at the start, at the end or every tick of the crafting process (see the phase property below).
The requirement type of command requirement is : "custommachinery:command".
Properties
The command requirement has 2 mandatory properties and 5 optional properties.
Mandatory properties
"type": "custommachinery:command" //Mandatory to define a command requirement.Optional properties
Permission level
Name : permissionlevel
permissionlevelDescription :
An integer that define the permission level the machine can run the command. In vanilla a player have a permission level of 1 and an op player have 4, see here for more infos.
Default : 2
Should be good enough to execute most commands.
Example :
"permissionlevel": 4The machine will run the command as an op.
Log
Description :
A boolean (true/false) that define if the machine should log the command when executed, if true a system message in the chat, console and logs will be shown. It can be used for debug.
Default : false
falseNo logs, the machine will print a message in the logs only when it fail to execute a command but never in the chat.
Example :
Will print the command result in the chat/console/logs when executed.
Delay
Name : delay
delayDescription :
A double value, between 0.0 and 1.0 that represents at which time of the recipe the command must be executed. A delay of 0.5 represent half of the recipe, 0.25 a quarter etc...
Default : 1
1The command will be executed at the end of the recipe process.
Example :
The command will be executed when the recipe progress time is at (approximatively) a third of the recipe total duration.
Example
A command requirement that will spawn a Zombie when the recipe finish with 50% chance:
Last updated