Repository navigation
[Mod] Editing Recipes
- Terraria Source
- Recipe.cs (Obvious?)
-
Open
Recipe.cs -
Navigate to
public static void SetupRecipes()by using the searchfunction or scrolling down to [Line 129]. -
You're gonna see something like this.
Recipe.addRecipe();Recipe.newRecipe.createItem.SetDefaults(28);Recipe.newRecipe.createItem.stack = 2;Recipe.newRecipe.requiredItem[0].SetDefaults(5);Recipe.newRecipe.requiredItem[1].SetDefaults(23);Recipe.newRecipe.requiredItem[1].stack = 2;Recipe.newRecipe.requiredItem[2].SetDefaults(31);Recipe.newRecipe.requiredItem[2].stack = 2;Recipe.newRecipe.requiredTile[0] = 13; -
Now what you want to do is to "out comment" (Place "//" in front of) everything with an exeption for theese 3 kinds of lines.
Recipe.addRecipe();Recipe.newRecipe.createItem.SetDefaults(<ID>/"Item Name");Recipe.newRecipe.createItem.stack = <ammount>; -
It should look like this
Recipe.addRecipe();Recipe.newRecipe.createItem.SetDefaults(28);Recipe.newRecipe.createItem.stack = 2;//Recipe.newRecipe.requiredItem[0].SetDefaults(5);//Recipe.newRecipe.requiredItem[1].SetDefaults(23);//Recipe.newRecipe.requiredItem[1].stack = 2;//Recipe.newRecipe.requiredItem[2].SetDefaults(31);//Recipe.newRecipe.requiredItem[2].stack = 2;//Recipe.newRecipe.requiredTile[0] = 13;
-
Some items (the Jungle set for example) doesnt have a Recipe, but that doesnt say we cant add one.. right?
-
To add a Recipe for the Jungle Hat, you simply add this (it's recommended to add new recipes at the bottom of the list, just in case something goes wrong and you need to edit the recipe).
Recipe.addRecipe();Recipe.newRecipe.createItem.SetDefaults("Jungle Hat");alternativeRecipe.newRecipe.createItem.SetDefaults(228)