Help with creating a vanilla recipe

LuckyMax5

Terrarian
So I'm pretty new with modding Terraria, and I have an error I can't figure out:
Error CS0118: 'CraftableStatues' is a namespace but is used as a type.

Here's the code I used:

using CraftableStatues.Items;
using Terraria;
using Terraria.ID;
using Terraria.GameContent.Creative;
using Terraria.ModLoader;

namespace CraftableStatues.Items
{
public class VanillaRecipes : ModItem
{
public override void AddRecipes()
{
var heartstatue = ModContent.GetInstance<CraftableStatues>();
CreateRecipe(ItemID.HeartStatue);
heartstatue.AddIngredient(ItemID.StoneBlock, 100);
heartstatue.AddIngredient(ItemID.LifeCrystal, 3);
heartstatue.AddIngredient(ItemID.LifeFruit, 3);
heartstatue.AddTile(TileID.Anvils);
heartstatue.Register();
}
}
}
 
Recipe code has changed in 1.4


Code:
using CraftableStatues.Items;
using Terraria;
using Terraria.ID;
using Terraria.GameContent.Creative;
using Terraria.ModLoader;

namespace CraftableStatues.Items
{
    public class VanillaRecipes : ModItem
    {
        public override void AddRecipes()
        {
            CreateRecipe()
            .AddIngredient(ItemID.StoneBlock, 100)
            .AddIngredient(ItemID.LifeCrystal, 3)
            .AddIngredient(ItemID.LifeFruit, 3)
            .AddTile(TileID.Anvils)
            .Register();
        }
    }
}
I see that you seem to want to change/add a recipe for a vanilla item.
That is, another set of problems as the code above is the right way to write a recipe but won't really do anything.
 
How would I go about making a recipe for a vanilla item? I’ve gotten a recipe for a mod accessory item working, but I keep getting errors with this. I haven’t been able to work it out from the guides I’ve seen, and there are a lot of guides that seem to be for the 1.3 version.
 
How would I go about making a recipe for a vanilla item? I’ve gotten a recipe for a mod accessory item working, but I keep getting errors with this. I haven’t been able to work it out from the guides I’ve seen, and there are a lot of guides that seem to be for the 1.3 version.
Then your code was almost right then!
You need to create a GlobalItem class, not a ModItem, so it would be something like this

Code:
public class VanillaRecipes : GlobalItem
{
    public override void AddRecipes()
    {
        Recipe recipe = Recipe.Create(ItemID.HeartStatue);
        recipe.AddIngredient(ItemID.StoneBlock, 100);
        recipe.AddIngredient(ItemID.LifeCrystal, 3);
        recipe.AddIngredient(ItemID.LifeFruit, 3);
        recipe.AddTile(TileID.Anvils);
        recipe.Register();
    }
}
 
Thank you, that helped! It took some tweaking but it works now!

EDIT: Do you know what the Graveyard Biome is called in Recipe.Condition? Because InGraveyard doesn’t work, but InDesert works fine and I can’t seem to find a list of Conditions for crafting anywhere
 
Last edited:
Thank you, that helped! It took some tweaking but it works now!

EDIT: Do you know what the Graveyard Biome is called in Recipe.Condition? Because InGraveyard doesn’t work, but InDesert works fine and I can’t seem to find a list of Conditions for crafting anywhere
1657267803738.png

I see a InGraveyardBiome here? Maybe that's what you are looking for.
 
Then your code was almost right then!
You need to create a GlobalItem class, not a ModItem, so it would be something like this

Code:
public class VanillaRecipes : GlobalItem
{
    public override void AddRecipes()
    {
        Recipe recipe = Recipe.Create(ItemID.HeartStatue);
        recipe.AddIngredient(ItemID.StoneBlock, 100);
        recipe.AddIngredient(ItemID.LifeCrystal, 3);
        recipe.AddIngredient(ItemID.LifeFruit, 3);
        recipe.AddTile(TileID.Anvils);
        recipe.Register();
    }
}
what if u wanted to add another recipe for ex u also wanted a penguin statue recipe, would u create a new class, write it underneath or what, if underneath how would it look?
 
Soak the vanilla beans in alcohol to bring out the distinct flavor. The alcohol will be destroyed in the baking process, so don't worry about intoxication.
 
Back
Top Bottom