mintchipthecoder
Terrarian
Im not able to add any items to my mod even though i have the code and sprites
the code for one of my items looks like this btw
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace sillymod21.Content.Items
{
public class MelonSword : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Melon Sword");
Tooltip.SetDefault("A sword forged from melonium, shoots out a terra blade projectile.");
}
public override void SetDefaults()
{
Item.damage = 145; // Set the sword's damage
Item.DamageType = DamageClass.Melee; // This is a melee weapon
Item.width = 40; // Hitbox width
Item.height = 40; // Hitbox height
Item.useTime = 10; // How fast the weapon is used
Item.useAnimation = 10; // How fast the animation plays
Item.useStyle = ItemUseStyleID.Swing; // The style of the weapon
Item.knockBack = 6; // Knockback power
Item.value = Item.sellPrice(gold: 10); // Item value
Item.rare = ItemRarityID.Green; // Rarity
Item.UseSound = SoundID.Item1; // Sound when used
Item.autoReuse = true; // Automatically swing the sword
Item.shoot = ProjectileID.TerraBeam; // Shoots the Terra Blade projectile
Item.shootSpeed = 10f; // Speed of the projectile
}
public override void AddRecipes()
{
Recipe recipe = CreateRecipe();
recipe.AddIngredient(ModContent.ItemType<Materials.Melonium>(), 10); // Requires 10 Melonium
recipe.AddTile(TileID.Anvils); // Crafted at an anvil
recipe.Register();
}
}
}
the code for one of my items looks like this btw
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace sillymod21.Content.Items
{
public class MelonSword : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Melon Sword");
Tooltip.SetDefault("A sword forged from melonium, shoots out a terra blade projectile.");
}
public override void SetDefaults()
{
Item.damage = 145; // Set the sword's damage
Item.DamageType = DamageClass.Melee; // This is a melee weapon
Item.width = 40; // Hitbox width
Item.height = 40; // Hitbox height
Item.useTime = 10; // How fast the weapon is used
Item.useAnimation = 10; // How fast the animation plays
Item.useStyle = ItemUseStyleID.Swing; // The style of the weapon
Item.knockBack = 6; // Knockback power
Item.value = Item.sellPrice(gold: 10); // Item value
Item.rare = ItemRarityID.Green; // Rarity
Item.UseSound = SoundID.Item1; // Sound when used
Item.autoReuse = true; // Automatically swing the sword
Item.shoot = ProjectileID.TerraBeam; // Shoots the Terra Blade projectile
Item.shootSpeed = 10f; // Speed of the projectile
}
public override void AddRecipes()
{
Recipe recipe = CreateRecipe();
recipe.AddIngredient(ModContent.ItemType<Materials.Melonium>(), 10); // Requires 10 Melonium
recipe.AddTile(TileID.Anvils); // Crafted at an anvil
recipe.Register();
}
}
}