Machine recipe
The basics of creating a custom machine recipe using json
Custom machine recipe jsons must be located in (my_datapack)/data/(namespace)/recipe/
(the same place as the vanilla recipes).
The (namespace) is a folder that can have any name, but must be all lowercase without spaces or special characters.
The machine name must be all lowercase with no spaces or any other characters than letters and numbers but you can use "_" or "/". The file must be a .json file.
Example : my_datapack/data/namespace/recipe/my_recipe.json
Each recipes loaded in the game must have a different ID, in the example above the recipe Id is : namespace:my_recipe
You can put any number of recipes under the same namespace or separate them.
You can also use subfolders like : (my_datapack)/data/(namespace)/recipe/machine1/my_recipe.json
so the recipe ID will be namespace:machine1/my_recipe
Just remember that all the recipe json should be under the recipes folder.
Recipe properties
The recipe json has 3 mandatory properties and 10 optional properties :
Mandatory properties
"type": "custommachinery:custom_machine" //Mandatory for defining a custom machine recipe.
Optional properties
RequirementsTemplate
A default recipe template with all properties specified :
{
"type": "custommachinery:custom_machine",
"machine": "namespace:my_machine",
"time": 200,
"requirements": [],
"jei": [],
"priority": 1000,
"jeiPriority": 1000,
"error": true,
"hidden": false,
"appearance": [],
"gui": [],
"cores": [],
"single_core": false
}
Example
A recipe that takes a diamond and turn it into energy :
{
"type": "custommachinery:custom_machine",
"machine": "custommachinery:my_machine",
"time": 1000,
"requirements": [
{
"type": "custommachinery:item",
"mode": "input",
"item": "minecraft:diamond",
"amount": 1
},
{
"type": "custommachinery:energy",
"mode": "output",
"amount": 1000
}]
}
Last updated