Adding workbench recipe
To add a new workbench recipe, you need to create a recipe json file in the assets/MODID/recipes/glassworkbench/
folder and write there:
{
"code": ...,
"input": {
"name": ...,
"type": ...,
"code": ...,
"allowedVariants": ...
},
"output": {
"type": ...,
"code": ...
},
"steps": []
}
The code
must be unique for each recipe.
Wildcards can be used for code
, output
and steps
.
Working on a workbench consists of several steps, each step describes the tool or action used in the process, the time it takes to execute this step, and the shape that will be obtained as a result of this step.
As an example, a step with a blowtorch:
"steps": [
{
"shape": { "base": "block/glassshape" },
"textures": { "glass0": { "base": "game:block/glass/vintage" } },
"tools": {
"blowtorch": { "temperature": 1300 }
},
"workpieceTransform": {
"translation": {
"x": -0.5,
"y": 0.6251,
"z": 0.2
},
"scale": 0.25
},
"useTime": 3
}
]
- The
shape
parameter is an intermediate preview of the item. Optional parameter. - The
textures
parameter overrides the shape textures. Optional parameter. - The
tools
parameter is a list of tools (and their parameters) required to work at this step. - The
workpieceTransform
parameter is the shape transformation at this step. Optional parameter. - The
useTime
parameter is the number of seconds required to craft an item. If not specified, then the step is performed in one click.