1.15.2 Custom texture data & signature CitizensAPI

Discussion in 'Spigot Plugin Development' started by cocoraid, Jan 23, 2020.

  1. Hey would like to known if this is possible to set a custom skin with only texture data and signature without uuid ?

    Because I've tried everything with the citizensAPI (latest):

    Code (Java):
      Location l = player.getLocation();
                NPC npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, "ยง4Banker");
       
                npc.data().set("nameplate-visible", true);

                npc.data().set(NPC.PLAYER_SKIN_TEXTURE_PROPERTIES_METADATA, Skin.HOSTESS.getTexture());
                npc.data().set(NPC.PLAYER_SKIN_TEXTURE_PROPERTIES_SIGN_METADATA, Skin.HOSTESS.getSignature());


                npc.data().set(NPC.PLAYER_SKIN_USE_LATEST, false);

                /*npc.data().setPersistent(NPC.PLAYER_SKIN_TEXTURE_PROPERTIES_METADATA, Skin.BANKER.getTexture());
                npc.data().setPersistent(NPC.PLAYER_SKIN_TEXTURE_PROPERTIES_SIGN_METADATA, Skin.BANKER.getSignature());
                npc.spawn(l);
                if (npc.isSpawned()) {

                    SkinnableEntity skinnable = npc.getEntity() instanceof SkinnableEntity ? (SkinnableEntity) npc.getEntity() : null;
                    if (skinnable != null) {
                        net.citizensnpcs.npc.skin.Skin.get(skinnable).applyAndRespawn(skinnable);

                    }
                }*/


                npc.spawn(l);
                //npc.data().setPersistent(NPC.PLAYER_SKIN_UUID_METADATA, "sovve");
                //npc.data().setPersistent(NPC.PLAYER_SKIN_USE_LATEST, false);
               // npc.despawn(DespawnReason.PENDING_RESPAWN);
               // npc.spawn(l, SpawnReason.RESPAWN);

    And the skin displayed is the skin named Banker not the custome texture one,
    Any idea ?

    EDIT: Sometimes it's working, sometimes not without changes, do not know why 0-o


    Thanks !
     
    #1 cocoraid, Jan 23, 2020
    Last edited: Jan 23, 2020