Error:
[12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 33. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 34. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 35. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 36. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 37. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 38. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 39. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 40. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 41. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 42. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 43. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 44. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 45. [12:13:06 ERROR]: [Citizens] The trait failed to load for NPC ID: 46..
Code:
new BukkitRunnable() {
@Override
public void run() {
NPC mainNPC = CitizensAPI.getNPCRegistry().getById(0);
NPC clonedNPC = mainNPC.clone();
clonedNPC.setName(ColorUtils.colorize(generateUsername()));
clonedNPC.spawn(safeLocation);
clonedNPC.getEntity().setMetadata("PvPBot", new FixedMetadataValue(KitPvP.getInstance(), true));
clonedNPC.getOrAddTrait(Equipment.class).set(Equipment.EquipmentSlot.HELMET, new ItemMaker(createRandomItem(helmetMaterials, helmetChances)).setEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, generateRandomEnchantement()).setUnbreakable(true).create());
clonedNPC.getOrAddTrait(Equipment.class).set(Equipment.EquipmentSlot.CHESTPLATE, new ItemMaker(createRandomItem(chestplateMaterials, chestplateChances)).setEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, generateRandomEnchantement()).setUnbreakable(true).create());
clonedNPC.getOrAddTrait(Equipment.class).set(Equipment.EquipmentSlot.LEGGINGS, new ItemMaker(createRandomItem(leggingsMaterials, leggingsChances)).setEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, generateRandomEnchantement()).setUnbreakable(true).create());
clonedNPC.getOrAddTrait(Equipment.class).set(Equipment.EquipmentSlot.BOOTS, new ItemMaker(createRandomItem(bootsMaterials, bootsChances)).setEnchant(Enchantment.PROTECTION_ENVIRONMENTAL, generateRandomEnchantement()).setUnbreakable(true).create());
clonedNPC.getOrAddTrait(Equipment.class).set(Equipment.EquipmentSlot.HAND, new ItemMaker(createRandomItem(handMaterials, handChances)).setEnchant(Enchantment.DAMAGE_ALL, generateRandomEnchantement()).setUnbreakable(true).create());
SentinelTrait sentinelcloned = clonedNPC.getOrAddTrait(SentinelTrait.class);
sentinelcloned.reach = MathUtils.Randomizer.generateDouble(3, 3.75);
sentinelcloned.attackRate = 1;
sentinelcloned.speed = MathUtils.Randomizer.generateDouble(1, 2);
sentinelcloned.armor = -1;
clonedNPC.data().setPersistent(NPC.Metadata.REMOVE_FROM_PLAYERLIST, true);
clonedNPC.data().setPersistent(NPC.Metadata.NAMEPLATE_VISIBLE, true);
clonedNPC.data().setPersistent(NPC.Metadata.SHOULD_SAVE, false);
clonedNPC.data().setPersistent(NPC.Metadata.WATER_SPEED_MODIFIER, 1.1f);
clonedNPC.data().setPersistent(NPC.Metadata.PATHFINDER_OPEN_DOORS, true);
clonedNPC.data().setPersistent(NPC.Metadata.DISABLE_DEFAULT_STUCK_ACTION, true);
spawnedBots++;
if (spawnedBots >= spawnedCount) {
spawnedBots = 0;
cancel();
}
}
}.runTaskLater(plugin, 20L * spawnedBots);
}```