juliarn / npc-lib

Asynchronous, high-performance Minecraft NPC library for 1.8-1.21 servers.
MIT License
320 stars 50 forks source link

Metadata Issue #67

Closed Branchyz closed 2 years ago

Branchyz commented 2 years ago

I'm trying to enable skin layers, but it doesn't work. I don't understand why, there is no console error.

I'm using 1.12.2.

This is my code for creating an NPC:

        NPC npc = NPC.builder()
                .profile(this.createProfile(name, skin))
                .location(location)
                .imitatePlayer(false)
                .lookAtPlayer(false)
                .build(this.npcPool);

        npc.metadata().queue(MetadataModifier.EntityMetadata.SKIN_LAYERS, true).send();

Is there something I'm doing wrong? Or is this just supposed to work.

Version: 2.6-RELEASE

derklaro commented 2 years ago

Hey,

the shown code will send the metadata directly after the creation of the npc to all players which are currently connected. The correct way is to set a spawn customiser and send out the metadata to the player the npc is being spawned for. Hope that helps!

Branchyz commented 2 years ago

That helped and now it works. Thanks for the help and for this lib.

derklaro commented 2 years ago

Good to hear!