Creating Custom Recipes
Last updated
Last updated
You can also make your own custom recipes in an addon data pack with this template below.
Rename the folder (opotional) ==>
Edit the pack.mcmeta file, so that it has the right pack_format
. You can find a list that tells you which pack format you need in which version of the game in the Minecraft Wiki.
Rename the name space of your data pack.
Go to the advancement.
Change this part to your data pack name space.
Go to the function that is set as a reward in the advancement.
Normally you shouldn't change anything in this function but here you also have to change the name spaces.
Next you'll have to make some sub-folders and copy files. Go to the folder named "wich _recipe" (I know it's spelled wrong) and create a new folder with the name of the item, that will be in the center of the recipe, but only if it doesn't already exists. In this new folder copy the two files from the stick folder and rename them. After you copied them, delete the whole stick folder.
If your enter item is for example a dirt block rename the files like this:
stick.mcfunction
=> dirt.mcfunction
stick1.mcfunction
=> dirt1.mcfunction
and if you have more than one recipe with the same center item just increase the number:
dirt2.mcfunction
dirt3.mcfunction
...
Open the renamed stick1.mcfunction
file.
In this function you specify a recipe, so I just call it a "recipe file".
The comment explains everything.
Here you can set the Mana cost. If you don't want a Mana cost just delete the whole line.
Here you can set the result of the recipe. You can use:
- /loot spawn ...
- /summon ...
Open the renamed stick.mcfunction
file.
In this file you list all recipe files that have a center item with the same name of this file, so I just call it a "center item parent file".
Ignore this comment
With this you can set that the recipe is only available after researching a specific thing. (this is not recommended and you should rather delete it with the comma)
If you want you can set Mana cost that the player has to have in order to craft the item.
(the dots are very important. Don't delete them if you have a Mana cost).
If you don't want a Mana cost delete mana matches 10..
and replace score
with entity
Change this to your data pack name space.
Change this to the folder name and file names that you changed them to. ( .../stick/stick1 ==> .../dirt/dirt1 )
If you now go 2 folder back you have to open this file.
In this file you have to list all center item parent file.
Here you have to enter the item id of the center item. If it is a custom item, only use the item id and nothing else.
Replace this with your data pack name space.
Replace this with the folder and center item parent file that have the same name as your center item.
If you did everything right you can now put the data pack in the datapack
folder of your world and after a /reload
command you should be able to craft your new recipe.