Hello. I have a question. How can I change a player's skin with a command, for example: /skin <name>? I have already tried the following code:
I'm running Paper Spigot 1.19.2
But it doesn't work. The player flickers briefly in-game and that's it. There is no error in the log or anything like that.
- PlayerProfile target = Bukkit.createProfile(args[0]);
- target.complete(true);
- PlayerProfile profile = player.getPlayerProfile();
- profile.setTextures(target.getTextures());
- player.setPlayerProfile(profile);
I'm running Paper Spigot 1.19.2