CitizensDev / Citizens

NPCs for Bukkit
citizensnpcs.co
Other
107 stars 53 forks source link

NPC armor will not appear #1180

Closed KokeCacao closed 8 years ago

KokeCacao commented 8 years ago
Equipment equip = npc.getTrait(Equipment.class);
        ItemStack hand = new ItemStack(mt1, 1, s1);
        equip.set(EquipmentSlot.HAND, hand);
        ItemStack helmet = new ItemStack(mt2, 1, s2);
        equip.set(EquipmentSlot.HELMET, helmet);
        ItemStack chestplate = new ItemStack(mt3, 1, s3);
        equip.set(EquipmentSlot.CHESTPLATE, chestplate);
        ItemStack leggings = new ItemStack(mt4, 1, s4);
        equip.set(EquipmentSlot.LEGGINGS, leggings);
        ItemStack boots = new ItemStack(mt5, 1, s5);
        equip.set(EquipmentSlot.BOOTS, boots);

When I was using CitizensAPI It will not output any error and it spawns NPC but no armor appear. (ItemStack must be true) How can I add armor? Thank-you

Edit: It is skeleton

KokeCacao commented 8 years ago

Solved: spawn before do this... Hope it helps you.