Register a death event for an NPC in your instance. This permanently removes the NPC from your game world and records the event.Death events are important for maintaining the state of your game world and ensuring that NPCs that are no longer active are properly tracked and removed from the instance.
Copy
// Register a death event for the NPCNPCDeathEvent deathEvent = PixocracySDK.NPCManager().registerDeathEvent(instance, npc);// The NPC is now considered dead and will be removed from the instance