Citizens Help

Discussion in 'Spigot Plugin Help' started by Kr1S_D, Jun 27, 2021.

  1. Why does he get despawned by spawning the npc giving this error?

    CODE
    Code (Text):
    private void spawnNPC() {
            FileConfiguration cf = PrisonAutoMiner.plugin.getConfig();
            PersonalizerManager manager = new PersonalizerManager(this.player);
            Location loc = this.player.getLocation();
            (this.npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, manager.getName().replaceAll("%player%", this.player.getName()))).spawn(loc);
            Equipment equipment = (Equipment)this.npc.getTrait(Equipment.class);
            SkinnableEntity skinnableEntity = (SkinnableEntity)this.npc.getEntity();
            skinnableEntity.setSkinName(this.player.getName(), true);
            if (manager.getOffhand() != Material.BARRIER) {
                equipment.set(Equipment.EquipmentSlot.OFF_HAND, new ItemStack(manager.getOffhand()));
            }
            if (manager.getMainhand() != Material.BARRIER) {
                equipment.set(Equipment.EquipmentSlot.HAND, new ItemStack(manager.getMainhand()));
            }
            if (manager.getHelmet() != Material.BARRIER) {
                equipment.set(Equipment.EquipmentSlot.HELMET, new ItemStack(manager.getHelmet()));
            }
            if (manager.getChestplate() != Material.BARRIER) {
                equipment.set(Equipment.EquipmentSlot.CHESTPLATE, new ItemStack(manager.getChestplate()));
            }
            if (manager.getLeggins() != Material.BARRIER) {
                equipment.set(Equipment.EquipmentSlot.LEGGINGS, new ItemStack(manager.getLeggins()));
            }
            if (manager.getBoots() != Material.BARRIER)
                equipment.set(Equipment.EquipmentSlot.BOOTS, new ItemStack(manager.getBoots()));
        }
    ERROR

    https://pastebin.com/F2ybuBAV
     
  2. Invalid yaw. Also, it is not known because it is not full logs.
     
  3. The only thing he gives is that mistake