using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespaceYOURMODHERE.Items
{
public class ITEMNAME : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("NAME");
Tooltip.SetDefault("DESCRIPTION");
}
public override void SetDefaults()
{
item.damage = 210;
item.melee = true;
item.width = 60;
item.height = 60;
item.useTime = 10;
item.useAnimation = 10;
item.useStyle = 1;
item.knockBack = 10;
item.value = 1000000;
item.rare = 11;
item.UseSound = SoundID.Item105;
item.autoReuse = true;
item.shoot = 132;
item.shootSpeed = 6f;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(INGREDIENT, AMOUNT);
recipe.AddTile(CRAFTINGSTATION);
recipe.SetResult(this);
recipe.AddRecipe();
}
public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit)
{
// you can add debuffs here or delete this entire section!
target.AddBuff(BuffID.Bleeding, 5 * 60);
target.AddBuff(BuffID.ShadowFlame, 15 * 60);
}
}
}
that code shoots a normal vanilla projectile, so hereCode:using Terraria; using Terraria.ID; using Terraria.ModLoader; namespaceYOURMODHERE.Items { public class ITEMNAME : ModItem { public override void SetStaticDefaults() { DisplayName.SetDefault("NAME"); Tooltip.SetDefault("DESCRIPTION"); } public override void SetDefaults() { item.damage = 210; item.melee = true; item.width = 60; item.height = 60; item.useTime = 10; item.useAnimation = 10; item.useStyle = 1; item.knockBack = 10; item.value = 1000000; item.rare = 11; item.UseSound = SoundID.Item105; item.autoReuse = true; item.shoot = 132; item.shootSpeed = 6f; } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(INGREDIENT, AMOUNT); recipe.AddTile(CRAFTINGSTATION); recipe.SetResult(this); recipe.AddRecipe(); } public override void OnHitNPC(Player player, NPC target, int damage, float knockBack, bool crit) { // you can add debuffs here or delete this entire section! target.AddBuff(BuffID.Bleeding, 5 * 60); target.AddBuff(BuffID.ShadowFlame, 15 * 60); } } }