Data Driven Recipes in StationAPI are defined in the JSON format. StationAPI expects your recipes to be in the src/main/resources/data/<modid>/stationapi/recipes/
folder, you can then use subfolders like crafting
, smelting
etc. to organize your recipes further, but it is not strictly necessary.
By default there are 3 crafting recipe types:
minecraft:crafting_shaped
- A recipe in the Crafting Table where the shape of the ingredients matters
minecraft:crafting_shapeless
- A recipe in the Crafting Table where the shape of the ingredients doesn’t matter and they can be in any shape
minecraft:smelting
- A recipe in the Furnace where 1 item is smelted into another
Shaped Crafting Recipe
A shaped crafting recipe requires you to specify a pattern with the accompanying keys and a result, let’s look at an example recipe:
resources/data/examplemod/stationapi/recipes/crafting/example_crafting_recipe_shaped.json
Let’s break this example down:
type
- here we specify the type of the recipe, in this case its a shaped recipe
pattern
- this is the pattern of the recipe, each letter represents 1 slot in the crafting table, what those items are is then defined in the key, a space means an empty slot, the pattern can also be 2x2 like this :
key
- here we assign an item or a tag to each of the letters in the pattern, to assign an item we use the item
key and write the registry name of the item under it, we can also specify the item meta (damage value) of the item under the damage
key. To use a tag we the tag
key and specify the tag together with its namespace under the the tag
key
result
- this is the output of the crafting recipe, its very similar to the item in key. You specify the item registry name under item
, then you can also define the amount of the items crafted with count
and the meta of the item using damage
And here is the result:
Shapeless Crafting Recipe
A shapeless crafting recipe only requires you to specify a list of ingredients, let’s look at an example recipe:
resources/data/examplemod/stationapi/recipes/crafting/example_crafting_recipe_shapeless.json
Let’s break this example down:
type
- here we specify the type of the recipe, in this case its a shapeless recipe
ingredients
- this is the list of ingredients, since its an shapeless recipe the order doesn’t matter, we can assign an item using the item
key and writing the registry name of the item under it, we can also specify the item meta (damage value) of the item under the damage
key. To use a tag we the tag
key and specify the tag together with its namespace under the the tag
key
result
- this is the output of the crafting recipe, its very similar to the item in ingredients. You specify the item registry name under item
, then you can also define the amount of the items crafted with count
and the meta of the item using damage
And here is the result:
Smelting Recipe
A smelting recipe is very similar to a shapeless recipe but it only requires a single ingredient, let’s look at an example:
resources/data/examplemod/stationapi/recipes/smelting/example_smelting_recipe.json
Let’s break this example down:
type
- here we specify the type of the recipe, in this case its a smelting recipe
ingredient
- this is the input ingredient, we can assign an item using the item
key and writing the registry name of the item under it, we can also specify the item meta (damage value) of the item under the damage
key. To use a tag we the tag
key and specify the tag together with its namespace under the the tag
key
result
- this is the output of the recipe, its very similar to the item in ingredient. You specify the item registry name under item
, then you can also define the amount of the items made with count
and the meta of the item using damage
And here is the result:
External Resources:
Minecraft Wiki/Recipe - Since StationAPI uses the modern data driven recipes, the basics of this are applicable, altho many of the things are straight up non-existent in Beta
Fabric Wiki/Crafting Recipes - This is also somewhat applicable, altho not really comprehensive
Examples:
Tropicraft Recipes
StationAPI Test Mod Recipes
NyaWiki Example Mod Recipes
Better Nether Beta Recipes