Moosta2112
Steampunker
When I try to name the weapon, I get this error:
Terraria.Item' does not contain a definition for 'name' and no extension method 'name' accepting a first argument of type 'Terraria.Item' could be found (are you missing a using directive or an assembly reference?)
Here is the code:
Terraria.Item' does not contain a definition for 'name' and no extension method 'name' accepting a first argument of type 'Terraria.Item' could be found (are you missing a using directive or an assembly reference?)
Here is the code:
Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Moreweapons.Projectile_Weapons
{
public class MoonThrowingKnife : ModItem
{
public override void SetDefaults()
{
item.name = "Moon Throwing Knife";
item.damage = 52;
item.useStyle = 5;
item.useAnimation = 18;
item.useTime = 25;
item.shootSpeed = 3.75f;
item.knockBack = 4.5f;
item.width = 24;
item.height = 40;
item.scale = 1f;
item.rare = 9;
item.UseSound = SoundID.Item1;
item.value = 10000;
item.melee = true;
item.autoReuse = true;
item.noMelee = true;
item.noUseGraphic = true;
item.shoot = mod.ProjectileType<Projectiles.MoonThrowingKnife>();
}
public override bool CanUseItem(Player player)
{
return player.ownedProjectileCounts[item.shoot] < 1;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.LunarBar, 2);
recipe.AddTile(TileID.MythrilAnvil);
recipe.SetResult(this);
recipe.AddRecipe();
}
}