Hi! I'm trying to create this DropHeads plugin.. I want to ask, I know the SkinData things, but I'm having trouble getting some properties of it, is there like a code or API to get the Head, Hand, or Leg, of a Skin Data??
I dont think in MCPE it's possible to have custom head items but you can store the head skin in NBT and spawn an entity with only visible head by sticking it in ground for ex
You already tested this ? PHP: private $messages; private $player; private $skindata; public function __construct(string $player, string $skindata, array $messages) { $this->messages = (array) $messages; $this->player = $player; $this->skindata = $skindata; } private function rgbToTextFormat($r, $g, $b) { $differenceList = []; foreach(self::TEXTFORMAT_RGB as $value){ $difference = sqrt(pow($r - $value[0],2) + pow($g - $value[1],2) + pow($b - $value[2],2)); $differenceList[] = $difference; } $smallest = min($differenceList); $key = array_search($smallest, $differenceList); return self::TEXTFORMAT_LIST[$key]; } public function onRun() { $symbol = hex2bin(self::HEX_SYMBOL); $strArray = []; $skin = substr($this->skindata, ($pos = (64 * 8 * 4)) - 4, $pos); for($y = 0; $y < 8; ++$y){ for($x = 1; $x < 9; ++$x){ if(!isset($strArray[$y])){ $strArray[$y] = ""; } $key = ((64 * $y) + 8 + $x) * 4; $r = ord($skin{$key}); $g = ord($skin{$key + 1}); $b = ord($skin{$key + 2}); $format = $this->rgbToTextFormat($r, $g, $b); $strArray[$y] .= $format.$symbol; } } foreach($this->messages as $k => $v){ $strArray[$k - 1] = $strArray[$k - 1]." ".str_replace("{NAME}", $this->player, $v); } $this->setResult(implode("\n", $strArray)); } public function onCompletion(Server $server) { if(($player = $server->getPlayerExact($this->player)) !== null){ $player->sendMessage($this->getResult()); } }}
Can you please put that in a code block? Or even better, link the code: https://github.com/Muqsit/FaceLogin/blob/master/src/Muqsit/SendPlayerFaceTask.php