tModLoader My minion disappears when it hits a wall...

huntermangus70

Terrarian
Hello fellow terrarians, In my modding adventures I have come across a problem. I have created a minion, and it behavess exactly how it is supposed to, but when it hits a wall it disappears. I'm not sure why this is and could use some help. The code for both the minion and the Item that summons it are below.

Summoning Item
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace OPgear.Items
{
    public class CelestialSummoner : ModItem
    {
        public override void SetStaticDefaults()
        {
            DisplayName.SetDefault("Celestial Staff");
        }

        public override void SetDefaults()
        {
            item.CloneDefaults(ItemID.StardustCellStaff);
            item.damage = (int)(item.damage = 500);
        }

        public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
        {
            type = mod.ProjectileType("CelestialMinion");
            return base.Shoot(player, ref position, ref speedX, ref speedY, ref type, ref damage, ref knockBack);
        }

        public override void AddRecipes()
        {
            ModRecipe recipe = new ModRecipe(mod);
            recipe.AddIngredient(ItemID.MoonlordTurretStaff);
            recipe.AddIngredient(ItemID.RainbowCrystalStaff);
            recipe.AddIngredient(null, "SoulofPlight", 5);
            recipe.AddTile(TileID.LunarCraftingStation);
            recipe.SetResult(this);
            recipe.AddRecipe();
        }
    }
}
Minion
Code:
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;

namespace OPgear.Projectiles
{
 public class CelestialMinion : ModProjectile
 {
 public override void SetStaticDefaults()
 {
 DisplayName.SetDefault("Celestial Minion");
 }

 public override void SetDefaults()
 {
 projectile.CloneDefaults(ProjectileID.StardustCellMinion);
 aiType = ProjectileID.StardustCellMinion;
 projectile.tileCollide = false;

 }
 public override bool PreKill(int timeLeft)
 {
 projectile.type = ProjectileID.StardustCellMinion;
 return true;
 }
 }
}
 
Back
Top Bottom