question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setSkin Method not working

See original GitHub issue

Spawning the NPC works fine and everything but the skin is missing for some reason. I already tried with multiple skins, versions, and an added delay for showing the NPC.

No error messages and NPCLib loads correctly.

NMS Version: v1_8_R3 NPCLib Version: 2.0

@EventHandler public void onJoin(PlayerJoinEvent e) {

    MineSkinFetcher.fetchSkinFromIdAsync(725954, skin -> {
        NPC npc = npcLib.createNPC(Arrays.asList(ChatColor.WHITE + "test")).
                setLocation(e.getPlayer().getLocation()).
                setSkin(skin).
                create();

        Bukkit.getScheduler().runTask(this, () -> npc.show(e.getPlayer()));
    });

}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
JitseBcommented, Aug 7, 2019
0reactions
JitseBcommented, Aug 7, 2019

My mistake! I forgot to update the GameProfile after the skin object changed.

Building v2.0.1 right now. Will post the release shortly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem with SetSkin() to change skin at runtime (Unity)
I've got a character model with a couple of skins 1) Light (a light armor look) 2) Heavy (a heavy armor look) I'm...
Read more >
Solved - Set Skin not working ? [api mojang]
Hi everybody, I am developing a plugin that restores skins using the Mojang API only I have an error in the console "Connection...
Read more >
Javascript: using apply() method on object instance ...
The first parameter should be specified. It will set the value of this inside the setSkin function. A.setSkin.apply(A, ['dhx_web']); A.setSkin.call(A, ...
Read more >
Control.skin.setSkin(Skin) fails to call dispose() on discarded ...
A DESCRIPTION OF THE PROBLEM : Control.skin.setSkin(Skin) discards a new Skin of the same class as the existing Skin, but fails to call...
Read more >
com.badlogic.gdx.scenes.scene2d.ui.Dialog.setSkin java code ...
How to use. setSkin. method. in. com.badlogic.gdx.scenes.scene2d.ui.Dialog ... Dialog.setSkin (Showing top 6 results out of 315). origin: libgdx/libgdx ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found