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
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