Skip to content

Custom Shaped Recipes

tterrag1098 edited this page Jun 9, 2015 · 7 revisions

When you first launch the game, your shapedRecipes.json file will look like this:

{"data":
    [
            
    ]
}

Shaped recipes have three values.

Value Type Description Default
input 2D String Array The input for the recipe. This is a 2D array for items, meaning it is defined as [["item1", "item2"], ["item3", "item4"]]. REQUIRED
output String The output of the recipe. REQUIRED
outputAmount Integer The amount of items this recipe outputs. 1

To add a shaped recipe, you must define a grid of items to use. For help defining items, see here.

Here is an example of a recipe that takes a 3x3 of iron ore to make a gold ore:

{"data":
    [
        {
            "input": [["oreIron", "oreIron", "oreIron"], 
                      ["oreIron", "oreIron", "oreIron"], 
                      ["oreIron", "oreIron", "oreIron"]],
            "output": "oreGold"
        }
    ]
}

The line breaks aren't necessary, but they help to visualize the grid of the recipe. A recipe doesn't need to be exactly 3x3 of course, here's the same recipe but using a 2x2 of iron ore.

{"data":
    [
        {
            "input": [["oreIron", "oreIron"], 
                      ["oreIron", "oreIron"]],
            "output": "oreGold"
        }
    ]
}

Finally, you do not need to define blank spaces in your recipe, they will be filled in automatically. Here is an example of a hoe recipe made of copper:

{"data":
    [
        {
            "input": [["ingotCopper", "ingotCopper"], 
                      ["stickWood"                 ],
                      ["stickWood"                 ]],
            "output": ""
        }
    ]
}

If a recipe requires blank spaces, this can be done using the "null" key word. Doing this is useful for shapes such as the "pickaxe" shape where it is not acceptable for all items to be pushed to the left side of the grid.

Once again, the formatting is optional but helps to visualize the recipe. As you can see, the second two string arrays only hold one string, yet this recipe is valid.

Clone this wiki locally