tModLoader welp, I got another issue now

spelunkyrocks

Terrarian
bruh moment
I keep on getting this error when building: MiscreantMod.AddRecipeGroups(): no suitable method found to override warnings
and again, heres my code:


using Terraria.Localization;
using MiscreantMod;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;

namespace MiscreantMod.Items
{
public class MiscreantMod : ModItem
{
public override void SetStaticDefaults() {
Tooltip.SetDefault("Almost everywhere, Really."); //The (English) text shown below your weapon's name
}

public override void SetDefaults() {
item.damage = 32; //The damage of your weapon
item.melee = true; //Is your weapon a melee weapon?
item.width = 40; //Weapon's texture's width
item.height = 40; //Weapon's texture's height
item.useTime = 20; //The time span of using the weapon. Remember in terraria, 60 frames is a second.
item.useAnimation = 20; //The time span of the using animation of the weapon, suggest set it the same as useTime.
item.useStyle = 1; //The use style of weapon, 1 for swinging, 2 for drinking, 3 act like shortsword, 4 for use like life crystal, 5 for use staffs or guns
item.knockBack = 6; //The force of knockback of the weapon. Maximum is 20
item.value = Item.buyPrice(gold: 4); //The value of the weapon
item.rare = 2; //The rarity of the weapon, from -1 to 13
item.UseSound = SoundID.Item1; //The sound when the weapon is using
item.autoReuse = true; //Whether the weapon can use automatically by pressing mousebutton
}

public override void AddRecipes() {
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.Wood, 10);
recipe.AddTile(TileID.Anvils);
recipe.AddRecipeGroup("AnyGoldBar", 10);
recipe.SetResult(this);
recipe.AddRecipe();
}
public override void AddRecipeGroups()

{
RecipeGroup group = new RecipeGroup(() => Language.GetTextValue("LegacyMisc.37") + " AnyGoldBar", new int[]
{
ItemID.GoldBar,
ItemID.PlatinumBar
});
RecipeGroup.RegisterGroup("MiscreantMod:AnyGoldBar", group);
}
 
Last edited:
bruh moment
I keep on getting this error when building: MiscreantMod.AddRecipeGroups(): no suitable method found to override warnings
and again, heres my code:


using Terraria.Localization;
using MiscreantMod;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
using static Terraria.ModLoader.ModContent;

namespace MiscreantMod.Items
{
public class MiscreantMod : ModItem
{
public override void SetStaticDefaults() {
Tooltip.SetDefault("Almost everywhere, Really."); //The (English) text shown below your weapon's name
}

public override void SetDefaults() {
item.damage = 32; //The damage of your weapon
item.melee = true; //Is your weapon a melee weapon?
item.width = 40; //Weapon's texture's width
item.height = 40; //Weapon's texture's height
item.useTime = 20; //The time span of using the weapon. Remember in terraria, 60 frames is a second.
item.useAnimation = 20; //The time span of the using animation of the weapon, suggest set it the same as useTime.
item.useStyle = 1; //The use style of weapon, 1 for swinging, 2 for drinking, 3 act like shortsword, 4 for use like life crystal, 5 for use staffs or guns
item.knockBack = 6; //The force of knockback of the weapon. Maximum is 20
item.value = Item.buyPrice(gold: 4); //The value of the weapon
item.rare = 2; //The rarity of the weapon, from -1 to 13
item.UseSound = SoundID.Item1; //The sound when the weapon is using
item.autoReuse = true; //Whether the weapon can use automatically by pressing mousebutton
}

public override void AddRecipes() {
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.Wood, 10);
recipe.AddTile(TileID.Anvils);
recipe.AddRecipeGroup("AnyGoldBar", 10);
recipe.SetResult(this);
recipe.AddRecipe();
}
public override void AddRecipeGroups()

{
RecipeGroup group = new RecipeGroup(() => Language.GetTextValue("LegacyMisc.37") + " AnyGoldBar", new int[]
{
ItemID.GoldBar,
ItemID.PlatinumBar
});
RecipeGroup.RegisterGroup("MiscreantMod:AnyGoldBar", group);
}
You can not add recipe groups in ModItem, you have to do that either in Mod or in ModRecipe.

Also, if you have multiple issues, please use a single thread for them, rather than making a new one for every individual issue. ;)
 
Back
Top Bottom