I'm writing set cape but error occurred. here's the error InvalidStateException: "Specified skin is not valid, must be 8KiB or 16KiB" (EXCEPTION) in "src/pocketmine/entity/Human" at line 148 and code PHP: $player = $event->getPlayer(); $path = $this->getDataFolder().'test.png'; //image path $oldSkin = $player->getSkin(); $im = imagecreatefrompng($path); $rgba = ""; for($y = 0; $y < imagesy($im); $y++) { for($x = 0; $x < imagesx($im); $x++) { $rgb = imagecolorat($im, $x, $y); $r = ($rgb >> 16) & 0xFF; $g = ($rgb >> 8) & 0xFF; $b = $rgb & 0xFF; $rgba .= chr($r).chr($g).chr($b).chr(255); } } $skin = new Skin($oldSkin->getSkinId(), $oldSkin->getSkinData(), $rgba, $oldSkin->getGeometryName(), $oldSkin->getGeometryData()); $player->setSkin($skin); $player->sendSkin();