"Make sure you have exactly one class extending Mod" error... help?!

face_punch

Terrarian
Okay, so the code was working perfectly fine, until I realized I forgotten a piece of code for the recipe. "No problem! I'll just go fix it rq" Boy, was I wrong. Once I fixed the recipe, it had no errors until I went to build and reload it in tmodloader. In which I got the "Make sure you have exactly one class extending Mod" error.
This is the code. It also showed no errors in microsoft visual code


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

namespace es.Items
{
public class w : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("testitem");
Tooltip.SetDefault("testitem");
}
public override void SetDefaults()
{
item.width = 20;
item.height = 20;
item.maxStack = 1;
item.rare = ItemRarityID.Blue;
item.value = Item.sellPrice(0, 0, 50, 0);
item.accessory = true;
}


public override void UpdateAccessory(Player player, bool hideVisual)
{

player.maxRunSpeed += 0.6f;
}

public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.Wood, 20);
recipe.AddIngredient(ItemID.StoneBlock, 15);
recipe.AddIngredient(ItemID.Gel, 10);
recipe.AddTile(TileID.Dirt);
recipe.SetResult(this);
recipe.AddRecipe();
}

}
}

Any help is a blessing at this point
 
You messed up something with your Mod Class. Which file are you trying to create this item in?
 
You messed up something with your Mod Class. Which file are you trying to create this item in?
Don't worry, I fixed it a few hours ago. Turns out, while trying to fix the recipe (fixed it like and hour after I fixed this) I deleted an important mod class file, but luckily I had a backup version.
 
You messed up something with your Mod Class. Which file are you trying to create this item in?
Oh, but I do have a question. So, I'm making a new workbench, and everything seems to be in order, but I want to animate it. I already have the sprite sheet ready and compatible with tmodloader, but I don't know how to code it. I'm guessing I'll need code similar to the furnaces in vanilla to make it animate.
 
Oh, but I do have a question. So, I'm making a new workbench, and everything seems to be in order, but I want to animate it. I already have the sprite sheet ready and compatible with tmodloader, but I don't know how to code it. I'm guessing I'll need code similar to the furnaces in vanilla to make it animate.
Check the Animated Loom, the Void Monolith, or Example Animated Tile from Example Mod. Also read the Basic Tile guide on the tModLoader Wiki Basic Tile · tModLoader/tModLoader Wiki
 
Back
Top Bottom