Player and NPC are classes in Terraria, so you need using Terraria; at the top.So, slight error, this is the logs:
Code:c:\Users\TheGeckoGamer\Documents\My Games\Terraria\ModLoader\Mod Sources\VarietyMod\VarietyMod\Items\SplitterAxe.cs(35,39) : error CS0246: The type or namespace name 'Player' could not be found (are you missing a using directive or an assembly reference?) c:\Users\TheGeckoGamer\Documents\My Games\Terraria\ModLoader\Mod Sources\VarietyMod\VarietyMod\Items\SplitterAxe.cs(35,54) : error CS0246: The type or namespace name 'NPC' could not be found (are you missing a using directive or an assembly reference?)
and this is my code:
Code:using Terraria.ID; using Terraria.ModLoader; namespace VarietyMod.Items { public class SplitterAxe : ModItem { public override void SetDefaults() { item.name = "Armor Splitter"; item.damage = 50; item.melee = true; item.width = 40; item.height = 40; item.toolTip = "An axe that can break even the toughest of armor."; item.useTime = 20; item.useAnimation = 20; item.useStyle = 1; item.knockBack = 6; item.value = 100000; item.rare = 2; item.useSound = 1; item.autoReuse = true; } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.DirtBlock, 10); recipe.AddTile(TileID.WorkBenches); recipe.SetResult(this); recipe.AddRecipe(); } public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.BrokenArmor, 30); } } }
I don't know what this issue is, I'm just trying to make the axe give the broken armor debuff.