When I`m trying to set skin of my NPC client crashes, but NPC spawns correctly, so without changing skin everything is fine. I have no errors in console. P.S. Before updating to mc 1.5 from 1.4 everything was fine. How I create skin PHP: $bytes = ''; $l = (int) @getimagesize($img_path)[1]; for ($y = 0; $y < $l; $y++) { for ($x = 0; $x < 64; $x++) { $rgba = @imagecolorat($img, $x, $y); $a = ((~((int) ($rgba >> 24))) << 1) & 0xff; $r = ($rgba >> 16) & 0xff; $g = ($rgba >> 8) & 0xff; $b = $rgba & 0xff; $bytes .= chr($r) . chr($g) . chr($b) . chr($a); } } @imagedestroy($img); $skin = new Skin('Standard_Custom', $bytes); How I send skin PHP: $pk = new PlayerSkinPacket(); $pk->uuid = $this->uuid; $pk->skin = $this->skin; $target->sendDataPacket($pk);
Try to use PlayerListPacket instead of PlayerSkinPacket: https://github.com/pmmp/PocketMine-MP/commit/4a5ff32d2ebe6a3c8365dcb0eb041d12cd329b2d
Look at how FloatingTextParticle handles it: https://github.com/pmmp/PocketMine-...l/particle/FloatingTextParticle.php#L118-L120