Error: I downloaded this 64x64 skin: https://minecraft.novaskin.me/skin/1154583057/64x64 Now it says that the skin data size is invalid. The Skin is in .png-Format. What to do? How i set the Skin: PHP: $nbt->setTag( new CompoundTag("Skin", [ "Data" => new StringTag("Data", Server::getInstance()->getDataPath() . "/plugin_data/NPC/skin.png"), "Name" => new StringTag("Name", "Standart_Custom")])); My full function: PHP: public function addNPC(){ $nbt = new CompoundTag; $path = $this->getDataFolder() . "skin.png"; $img = @\imagecreatefrompng($path); $byte = ""; for($y = 0, $height = imagesy($img); $y < $height; $y++){ for($x = 0, $width = imagesx($img); $x < $width; $x++){ $color = imagecolorat($img, $x, $y); $byte .= pack("c", ($color >> 16) & 0xFF) . pack("c", ($color >> 8) & 0xFF) . pack("c", $color & 0xFF) . pack("c", 255 - (($color & 0x7F000000) >> 23)); } } $nbt->setTag( new ListTag("Pos", [ new DoubleTag("X", "-26.6"), new DoubleTag("Y", "50"), new DoubleTag("Z", "4.49") ])); $nbt->setTag( new ListTag("Motion", [ new DoubleTag("", 0), new DoubleTag("", 0), new DoubleTag("", 0) ])); $nbt->setTag( new ListTag("Rotation", [ new FloatTag("", "275"), //230, 250 new FloatTag("", "0") ])); $nbt->setTag(new ShortTag("Health", 20)); $nbt->setTag( new CompoundTag("Skin", [ "Data" => new StringTag("Data", $this->getDataFolder() . "skin.png"), "Name" => new StringTag("Name", "Standart_Custom") ])); $level = Server::getInstance()->getLevelByName("world"); $human = new Human($level, $nbt); $human->setNameTag("§bSkyBlock\n§r§lTIPPE MICH ZUM BEITRETEN!"); $human->setNameTagVisible(false); $human->setScale(1.5); $human->spawnToAll();} PocketMine only allowes this sizes: Skin.php (PocketMine.php): PHP: public const ACCEPTED_SKIN_SIZES = [ 64 * 32 * 4, 64 * 64 * 4, 128 * 128 * 4]; I created my skin in BlockBench and it is 64 x 64...
Skin data needs to be a byte array containing the individual pixels. I made a virion that converts PNG to skin data and vice versa, you can see how it does that or directly use it in your plugin: https://github.com/HimbeersaftLP/Li...src/Himbeer/LibSkin/SkinConverter.php#L45-L78