MGTro (Dice)
Terrarian
Hello. I've been trying to make a new mod lately, but I don't understand how the new IEntitySource works.. I want to experiment by making town npcs drop tombstones on death, just like players do. But I come across this:
Item.NewItem(npc.GetSource_Death(), tombstone);
It wont let me go further because I don't have an IEntitySource thing added. Here's the full class:
Item.NewItem(npc.GetSource_Death(), tombstone);
It wont let me go further because I don't have an IEntitySource thing added. Here's the full class:
Code:
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace npcTombstones
{
public class TombstoneNPC : GlobalNPC
{
public override void OnKill(NPC npc)
{
if (!npc.townNPC)
{
return;
}
Item tombstone = new Item();
tombstone.SetDefaults(ItemID.Tombstone);
tombstone.position = npc.position;
Item.NewItem(npc.GetSource_Death(), tombstone);
}
}
}