PHP: $bytes = static::getTextureFromFile(Core::getInstance()->getDataFolder()."skins_herobrine.png"); $this->setSkin(new Skin($this->skin->getSkinId(), $bytes)); $this->sendSkin(); public static function getTextureFromFile(string $path): string { $img = @imagecreatefrompng($path); $bytes = ''; $l = (int) @getimagesize($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); return $bytes; } Code: InvalidStateException: "HerobrineBoss must have a valid skin set" (EXCEPTION) in "src/pocketmine/entity/Human" at line 121 Class is human entity and skins_herobrine.png in have how to fix?
https://github.com/thebigsmileXD/Slenderman/tree/master/ Maybe that plugin can help you. What it does is that it generates an entity as if it were a player and with a skin that you can choose