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

Change player head skin

Discussion in 'Development' started by SerezhaIvanov, Mar 30, 2020.

  1. SerezhaIvanov

    SerezhaIvanov Silverfish

    Messages:
    23
    GitHub:
    serezhaivanov02
    I have skins for head (below), how i can set it on player? To change just head.

    upload_2020-3-30_15-28-7.png
     
  2. Invy55

    Invy55 Witch

    Messages:
    52
    GitHub:
    invy55
    I think, BUT I THINK(maybe it isn't correct), that this isn't possible todo with a simple method. I think that you need to edit the skin image that the palyer has and then apply to the player. If there isn't anyother method I'll help you to do this.

    EDIT: Ok I really think this is the anly way can you please send me this image here on the forum, not the 3d version but the 2d to see how is your image and design a code that uses the image library of php?
     
  3. GamakCZ

    GamakCZ Zombie Pigman

    Messages:
    598
    GitHub:
    GamakCZ
    You have to find on whose pixels is the head located, then just replace it with the custom head
     
  4. Invy55

    Invy55 Witch

    Messages:
    52
    GitHub:
    invy55
    Ok, so that can be done with some magic. Just kidding is pretty easy using the https://www.php.net/manual/en/book.image.php
     
  5. GamakCZ

    GamakCZ Zombie Pigman

    Messages:
    598
    GitHub:
    GamakCZ
    It's hard to write code for that, so I'm just posting the way I have done it through.

    It's not called magic, it's php

    There are some tips to check
    https://www.php.net/manual/en/function.imagecreate.php
    https://www.php.net/manual/en/function.imagecolorat.php
    https://github.com/BlockHorizons/Li...rizons/LibSkinChanger/PlayerSkin.php#L98-L119
     
  6. wolfdale

    wolfdale Zombie Pigman

    Messages:
    535
    GitHub:
    diamond-gold
    GamakCZ likes this.
  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.