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

Setting Skin to Player resulted in Alex skin

Discussion in 'Development' started by instantlyta, Jan 12, 2017.

  1. instantlyta

    instantlyta Slime

    Messages:
    96
    GitHub:
    intagaming
    I tried the setSkin() with the variables of the getSkinData() and getSkinId() function in Player. Even when i tried to reload the Player Data List:
    PHP:
    $player->despawnFromAll();
            foreach (
    $player->getServer()->getOnlinePlayers() as $player1)
                
    $player->getServer()->removePlayerListData($player1->getUniqueId());
            foreach (
    $player->getServer()->getOnlinePlayers() as $player1)
                
    $player->getServer()->sendFullPlayerListData($player1);
            
    $player->spawnToAll();
    It still set the player to Alex skin.
    It worked before the 1.0 update. What's the new way to set the skin?
     
  2. kaliiks

    kaliiks Zombie

    Messages:
    250
    PHP:
     $player->setSkin($player->getSkinData(), 'Alex');[PHP]
     
  3. instantlyta

    instantlyta Slime

    Messages:
    96
    GitHub:
    intagaming
    I want to set the player skin to another player skin, but not Alex!
     
  4. kaliiks

    kaliiks Zombie

    Messages:
    250
    Save another players skin to file and set to player
     
  5. instantlyta

    instantlyta Slime

    Messages:
    96
    GitHub:
    intagaming
    Yes, tried with .skin (zlib) and traditional .png, no result.
     
  6. instantlyta

    instantlyta Slime

    Messages:
    96
    GitHub:
    intagaming
    API Change! the Human's setSkin() doesn't have slim variable anymore. Sorry for wrong infomation.
    And, the second variable should be
    Code:
    "Standard_Custom"
    for someone who meets this problem and didn't notice the function change.
     
  7. SalmonDE

    SalmonDE Zombie Pigman

    Messages:
    739
    GitHub:
    SalmonDE
    The function didn't change. You can also use Standard_CustomSlim as Skin ID. This also worked before 1.0.0.
     
  8. instantlyta

    instantlyta Slime

    Messages:
    96
    GitHub:
    intagaming
    I used SkinUtils of someone and it worked before 1.0.0, now it doesn't. You can yourself proof it.
    EDIT: aliuly's SkinUtils
     
  9. SalmonDE

    SalmonDE Zombie Pigman

    Messages:
    739
    GitHub:
    SalmonDE
    False, it still works with 1.0.0. But the change isn't viewable for the player who's skin was changed.
     
  10. instantlyta

    instantlyta Slime

    Messages:
    96
    GitHub:
    intagaming
    Of course it isn't viewable for the player who's skin was changed, but for other players except that player?
     
    SalmonDE likes this.
  11. SalmonDE

    SalmonDE Zombie Pigman

    Messages:
    739
    GitHub:
    SalmonDE
    It was sometimes viewable for the own player, too BEFORE 1.0.0(/0.16.0, not sure :confused:). For other players it's always visible. :)
     
    Last edited: Jan 14, 2017
  12. instantlyta

    instantlyta Slime

    Messages:
    96
    GitHub:
    intagaming
    So that means if you pass Boolean through the SkinId variable it still usable?
     
  13. SalmonDE

    SalmonDE Zombie Pigman

    Messages:
    739
    GitHub:
    SalmonDE
    I only tested with valid SkinIDs. lol
     
  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.