PHP code example of playzone / minecraft-skin

1. Go to this page and download the library: Download playzone/minecraft-skin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

playzone / minecraft-skin example snippets



n = new \Playzone\Skin\MinecraftCape();

try {
    $skin->loadPNG('cape_22x17.png');
} catch (\Playzone\Skin\Exceptions\SkinException $e) {
    die ('EXCEPTION: '.$e->getMessage());
}

header('Content-Type: image/png');

# Will print standart 64x32 cape image with elytras
imagepng($skin->getFullCape(true, true));