// Generate a new UUID for the NPC
UUID npcUuid = UUID.randomUUID();
// Set the NPC's name and spawn type
String name = "Village Guard";
SpawnType spawnType = SpawnType.MANUAL;
// Register the NPC spawn event
NPCSpawnEvent spawnEvent = PixocracySDK.NPCManager().registerSpawnEvent(instance, npcUuid, name, spawnType);
// Access the spawned NPC
NPC npc = spawnEvent.getNpc();