hasTag(self::TAG_COLOR, ByteTag::class)){ //TODO: check PC format $nbt->setByte(self::TAG_COLOR, 14, true); //default to old red } parent::__construct($level, $nbt); } public function getColor() : int{ return $this->namedtag->getByte(self::TAG_COLOR); } public function setColor(int $color){ $this->namedtag->setByte(self::TAG_COLOR, $color & 0x0f); $this->onChanged(); } public function addAdditionalSpawnData(CompoundTag $nbt) : void{ $nbt->setTag($this->namedtag->getTag(self::TAG_COLOR)); } protected static function createAdditionalNBT(CompoundTag $nbt, Vector3 $pos, ?int $face = null, ?Item $item = null, ?Player $player = null) : void{ $nbt->setByte(self::TAG_COLOR, $item !== null ? $item->getDamage() : 14); //default red } }