Board Thread:Game Help/@comment-40068880-20190708003430

(Just in advance, sorry if this is in the wrong forum.) In Terraria I'm trying to make a non consumable throwing weapon, but, it still drops itself when thrown giving me extra copies of the weapon. How would I fix this? Here's the code and thanks in advance!

___________________________________________________________________________________

using Terraria; using Terraria.ID; using Terraria.ModLoader; using Microsoft.Xna.Framework; using System;

namespace PlentyOWeapons.Projectiles {  public class ThrowingDaggerProjectile : ModProjectile {      public override void SetStaticDefaults {          DisplayName.SetDefault("ThrowingDaggerProjectile"); }

public override void SetDefaults {          projectile.width = 18; projectile.height = 24; projectile.aiStyle = 1; projectile.friendly = true; projectile.melee = true; projectile.penetrate = 4; }

public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) {          if(targetHitbox.Width > 8 && targetHitbox.Height > 8) {              targetHitbox.Inflate(-targetHitbox.Width / 8, -targetHitbox.Height / 8); }          return projHitbox.Intersects(targetHitbox); }

public override void Kill(int timeLeft) {          Main.PlaySound(0, (int)projectile.position.X, (int)projectile.position.Y, 1, 1f, 0f); Vector2 usePos = projectile.position; Vector2 rotVector = (projectile.rotation - MathHelper.ToRadians(90f)).ToRotationVector2; usePos += rotVector * 16f;

int item = 0; if(Main.netMode == 1 && item >= 0) {              NetMessage.SendData(MessageID.KillProjectile); }          if (Main.rand.NextFloat < 0.18f) {              item = Item.NewItem((int)projectile.position.X, (int)projectile.position.Y, projectile.width, projectile.height, mod.ItemType, 1, false, 0, false, false); }          if (Main.netMode == 1 && item >= 0) {              NetMessage.SendData(Terraria.ID.MessageID.SyncItem, -1, -1, null, item, 1f, 0f, 0f, 0, 0, 0); }      }

private const float maxTicks = 60f; private const int alphaReducation = 25;

} } 