-
Notifications
You must be signed in to change notification settings - Fork 17
Command Requirement
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"
.
The Command Requirement have 3 mandatory properties and 3 optional properties.
Type
"type": "custommachinery:command"
Command
A string which represent the command to run, it must have the same syntax as when you run command in the chat (so begin with "/").
"command": "/time set 0"
The machine's world time will be set to 0.
Phase
A string that define when the command will be executed. Available phases are:
-
starting
: The command will be executed at the start of the crafting process after all input requirements have been processed. -
crafting_tickable
: The command will be executed each tick of the crafting process. -
ending
: The command will be executed at the end of the crafting process after all output requirements have been processed.
"phase": "starting"
The command will be executed when the process start.
Permission level
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.
"permissionlevel": 2
Should be good enough to execute most commands.
"permissionlevel": 4
The machine will run the command as an op.
Log
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.
"log": false
No logs, the machine will print a message in the logs only when it fail to execute a command but never in the chat.
"log": "true"
Will print the command result in the chat/console/logs when executed.
Chance
A double between 0.0 and 1.0 that define the chance of the command to be run.
"chance": 1.0
The command will always be run.
"chance": 0.7
The command will have 70% chance to be run.
A Command Requirement that will spawn a Zombie when the recipe finish with 50% chance:
{
"type": "custommachinery:command",
"command": "/summon minecraft:zombie",
"phase": "ending",
"permission": 4,
"chance": 0.5
}
3. Machine GUI
- Dump Element
- Energy Element
- Fluid Element
- Fuel Element
- Player Inventory Element
- Progress Bar Element
- Reset Element
- Slot Element
- Status Element
- Text Element
- Texture Element
5. Catalysts
- Biome Requirement
- Block Requirement
- Command Requirement
- Dimension Requirement
- Drop Requirement
- Durability Requirement
- Effect Requirement
- Energy Requirement
- Energy Per Tick Requirement
- Entity Requirement
- Fluid Requirement
- Fluid Per Tick Requirement
- Fuel Requirement
- Item Requirement
- Light Requirement
- Loot Table Requirement
- Position Requirement
- Structure Requirement
- Redstone Requirement
- Time Requirement
- Weather Requirement