Making a crafting material

Aaronmaster125

Terrarian
I want to make a crafting material for my mod but I can't figure out how to do it. For example, something like the vine in normal terraria.
 
Items automatically become a material once you include it in any recipe.
The recipes can be added in any item file, but its probably better to add the recipes in relevant files. (Either the recipe in the file of its result, or if its a vanilla item, in the material's file.)
Heres an example on adding recipes to items.

Code:
public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.IronBar, 7); //Adding a vanilla item
            recipe.AddIngredient(null, "ExampleItem", 3); //Adding a modded item
            recipe.AddTile(null, "ExampleTile"); //Adding a modded tile
            recipe.SetResult(this); //Sets the result to whatever item this code is in.
            recipe.AddRecipe();

            ModRecipe Lead = new ModRecipe(mod); //"Lead" is the name of this other recipe. You can have as many recipes as you want in a single file but must name then all differently
            Lead.AddIngredient(ItemID.LeadBar,  7);
            Lead.AddIngredient(null, "ExampleItem", 3);
            Lead.AddTile(TileID.Workbenches); //Vanilla tile
            Lead.SetResult(null, "ExampleItem2"); // Or do the same thing for vanilla item to set the recipe result to a vanilla item.
            Lead.AddRecipe();
        }
 
Back
Top Bottom