NBT-API

NBT-API

98.9k Downloads

Citizens support?

Dymeth opened this issue ยท 2 comments

commented

Hello!
It would be nice to be able to add NBT tags to NPCs from Citizens.
I have the following code, however it does not apply NBT tags to NPCs.

NPC npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, "name");
npc.spawn(player.getLocation());
NBTEntity nbt = new NBTEntity(npc.getEntity());
NBTCompound compound = new NBTContainer("{HandItems:[{Count:1,id:iron_sword},{}]}");
nbt.mergeCompound(compound);
commented

I don't think this is possible in that way(without Citizens implementing something special). There should be some Citizens API to add custom data to NPC, maybe check how extensions like for example Sentry save their custom data to NPC's.

commented

Thank you ๐Ÿ˜Š