error cs1513 } expected

qbikkk

Terrarian
so when i was making a mod with leaf themed sword wich gives poison but i keep getting errors
C#:
using Terraria.ID;
using Terraria.ModLoader;

namespace chlorofilpogofil.Items
{
    public class chlorofilpogofil : ModItem
    {
        public override void SetStaticDefaults()
        {
            // DisplayName.SetDefault("chlorofilpogofil"); // By default, capitalization in classnames will add spaces to the display name. You can customize the display name here by uncommenting this line.
            Tooltip.SetDefault("haha leaf goes brrrrrrrrrrrrrrrr.");
        }

        public override void SetDefaults()
        {
            item.damage = 15;
            item.melee = true;
            item.width = 40;
            item.height = 40;
            item.useTime = 10;
            item.useAnimation = 10;
            item.useStyle = 1;
            item.knockBack = 6;
            item.value = 10000;
            item.rare = 2;
            item.UseSound = SoundID.Item1;
            item.autoReuse = true;
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.Vine, 7);
            recipe.AddTile(TileID.WorkBenches);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }

        public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
        {
            // Add the Onfire buff to the NPC for 1 second when the weapon hits an NPC
            // 60 frames = 1 second
            target.AddBuff(BuffID.Poisoned, 60);
        }
 
From the copied code I see here it seems you are missing brackets, explaining the error message. I counted 6 open brackets and only 4 close brackets in the copied code, so unless the other brackets are located elsewhere in the code, you need to add them. If they are located elsewhere, can you send the full code with closed brackets included?
 
Back
Top Bottom