getTag(self::TAG_SKULL_TYPE)) instanceof ByteTag){ $mobHeadType = MobHeadTypeIdMap::getInstance()->fromId($skullTypeTag->getValue()); if($mobHeadType === null){ throw new SavedDataLoadingException("Invalid skull type tag value " . $skullTypeTag->getValue()); } $this->mobHeadType = $mobHeadType; } $rotation = $nbt->getByte(self::TAG_ROT, 0); if($rotation >= 0 && $rotation <= 15){ $this->rotation = $rotation; } } protected function writeSaveData(CompoundTag $nbt) : void{ $nbt->setByte(self::TAG_SKULL_TYPE, MobHeadTypeIdMap::getInstance()->toId($this->mobHeadType)); $nbt->setByte(self::TAG_ROT, $this->rotation); } public function setMobHeadType(MobHeadType $type) : void{ $this->mobHeadType = $type; } public function getMobHeadType() : MobHeadType{ return $this->mobHeadType; } public function getRotation() : int{ return $this->rotation; } public function setRotation(int $rotation) : void{ $this->rotation = $rotation; } protected function addAdditionalSpawnData(CompoundTag $nbt) : void{ $nbt->setByte(self::TAG_SKULL_TYPE, MobHeadTypeIdMap::getInstance()->toId($this->mobHeadType)); $nbt->setByte(self::TAG_ROT, $this->rotation); } }