1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Changing player skin for self

Discussion in 'Facepalm' started by #A6543, Jun 19, 2017.

  1. #A6543

    #A6543 Zombie

    Messages:
    267
    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
     
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    despawnFrom(Player), spawnTo(Player)?
     
  3. #A6543

    #A6543 Zombie

    Messages:
    267
    FromAll and ToAll is spawnTo and despawnFrom for Alle players. (Including the changed player?!!?)
     
  4. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    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.
     
  5. #A6543

    #A6543 Zombie

    Messages:
    267
    This doesn't change anything
     
  6. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    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
     
    SOFe likes this.
  7. #A6543

    #A6543 Zombie

    Messages:
    267
    In the PC version it's possible :/
     
  8. #A6543

    #A6543 Zombie

    Messages:
    267
    I've seen it on a server!
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.