#Adding skins to npc using citizens API

1 messages · Page 1 of 1 (latest)

lost umbra
#

Hello, I'm trying to add an npc and applying a skin to him using mienskin. I have the skin I want, but doesn't display the right skin (it randomises the skin every reload). Here is my code:

NPCRegistry registry = CitizensAPI.getNPCRegistry();
 net.citizensnpcs.api.npc.NPC npc = registry.createNPC(EntityType.PLAYER, "npc test");
World world= Bukkit.getWorlds().get(0);
Location loc=new Location(world,-41,200,-120);
SkinTrait skin=npc.getOrAddTrait(SkinTrait.class);
skin.setTexture([value of the target skin copied form mineskin],[signature of the target skin copied on mineskin]);
npc.spawn(loc);

Any help is greatly appreciated !