Click here to Skip to main content
13,770,657 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hello, I have a problem, and since I am a beginner, I know close to nothing about this subject, I am trying to make a mod for Terraria 1.3.5, here are the scripts:

using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace op_weapons.Items
{
    public class TrueHell : ModItem
    {
        public override void SetDefaults()
        {
            Item.name = "Omega Eye";
            Item.maxStack = 999;
            Item.Width = 40;
            Item.height = 40;
            Item.value = 1230000;
            Addtooltip("The legendary item");
        }

        public override void AddRecipe()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.GrayBrick);
            recipe.SetResult(this, 2);
            recipe.AddRecepie();
        }
    }
}


the new error is:

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(12,18) : error CS0117: 'Terraria.Item' does not contain a definition for 'name'

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(13,13) : error CS0120: An object reference is required for the non-static field, method, or property 'Terraria.Item.maxStack'

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(14,18) : error CS0117: 'Terraria.Item' does not contain a definition for 'Width'

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(15,13) : error CS0120: An object reference is required for the non-static field, method, or property 'Terraria.Entity.height'

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(16,13) : error CS0120: An object reference is required for the non-static field, method, or property 'Terraria.Item.value'

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(17,13) : error CS0103: The name 'Addtooltip' does not exist in the current context

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(23,20) : error CS1061: 'op_weapons.Items.ModRecipe' does not contain a definition for 'AddIngredient' and no extension method 'AddIngredient' accepting a first argument of type 'op_weapons.Items.ModRecipe' could be found (are you missing a using directive or an assembly reference?)

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(24,20) : error CS1061: 'op_weapons.Items.ModRecipe' does not contain a definition for 'SetResult' and no extension method 'SetResult' accepting a first argument of type 'op_weapons.Items.ModRecipe' could be found (are you missing a using directive or an assembly reference?)

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(25,13) : error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(25,20) : error CS1061: 'op_weapons.Items.ModRecipe' does not contain a definition for 'AddRecipe' and no extension method 'AddRecipe' accepting a first argument of type 'op_weapons.Items.ModRecipe' could be found (are you missing a using directive or an assembly reference?)

What I have tried:

I have tried changing the name, changing the recipe, changing the texture, changing the name of the mod, I have watched multiple videos on how to fix it, but none of them worked.
Posted 13-Jun-18 7:17am
Updated 13-Jun-18 12:41pm
v5

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

That looks like a spelling mistake :) It's AddRecipe / AddRecipes.

public override void AddRecipes()
{
    ModRecipe recipe = new ModRecipe(mod);
    recipe.AddIngredient(ItemID.GrayBrick);
    recipe.SetResult(this, 2);
    recipe.AddRecipe();
}
  Permalink  
v3
Comments
OriginalGriff 13-Jun-18 12:37pm
   
I dunno - I could eat a rece pie right now!
Member 13871461 13-Jun-18 13:25pm
   
hahaha, I started this morning. and i only know this code...
Member 13871461 13-Jun-18 13:27pm
   
oh, and it is not a spelling mistake.
[no name] 13-Jun-18 13:28pm
   
public override void AddRecepies() <- This should be AddRecipes
recipe.AddRecepie(); <- This should be AddRecipe
Member 13871461 13-Jun-18 13:33pm
   
thank you for helping me for that, but, new problem,also sorry for using your time, i'm not even in highscool
Member 13871461 13-Jun-18 13:34pm
   
here is the new error.

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(12,18) : error CS0117: 'Terraria.Item' does not contain a definition for 'name'

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(13,13) : error CS0120: An object reference is required for the non-static field, method, or property 'Terraria.Item.maxStack'

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(14,18) : error CS0117: 'Terraria.Item' does not contain a definition for 'Width'

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(15,13) : error CS0120: An object reference is required for the non-static field, method, or property 'Terraria.Entity.height'

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(16,13) : error CS0120: An object reference is required for the non-static field, method, or property 'Terraria.Item.value'

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(17,13) : error CS0103: The name 'Addtooltip' does not exist in the current context

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(23,20) : error CS1061: 'op_weapons.Items.ModRecipe' does not contain a definition for 'AddIngredient' and no extension method 'AddIngredient' accepting a first argument of type 'op_weapons.Items.ModRecipe' could be found (are you missing a using directive or an assembly reference?)

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(24,20) : error CS1061: 'op_weapons.Items.ModRecipe' does not contain a definition for 'SetResult' and no extension method 'SetResult' accepting a first argument of type 'op_weapons.Items.ModRecipe' could be found (are you missing a using directive or an assembly reference?)

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(25,13) : error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement

c:\Users\chedl\Documents\My Games\Terraria\ModLoader\Mod sources\op weapons\Items\TrueHell.cs(25,20) : error CS1061: 'op_weapons.Items.ModRecipe' does not contain a definition for 'AddRecipe' and no extension method 'AddRecipe' accepting a first argument of type 'op_weapons.Items.ModRecipe' could be found (are you missing a using directive or an assembly reference?)

[no name] 13-Jun-18 13:44pm
   
Check the capitalisation: it's item.name, item.width, item.height etc, all lower case. And AddTooltip instead of Addtooltip.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web06-2016 | 2.8.181119.1 | Last Updated 13 Jun 2018
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100