I use setSkin and despawnFromAll() / spawnToAll() to change the skin of a player. But the new skin is only shown to the other players. How can I show the new skin for the player itself? Please also me if you need more information
Maybe try updating the player list? (which also updates the skin). PHP: $player->getServer()->updatePlayerListData($player->getUniqueId(), $player->getId(), $player->getName(), $player->getSkinId(), $player->getSkinData(), [$player]); It sends PlayerListPacket to the player (aside from skin, that packet is responsible for updating player's name in the pause aka "escape button" menu too. I hope that solves what you're trying to do.
i dont think the server can change the player's skin and show it to player afaik the client will always use the local skin