public function setNamedTag(CompoundTag $tag) { if ($tag->getCount() === 0) { return $this->clearNamedTag(); } $this->cachedNBT = $tag; $this->tags = self::writeCompoundTag($tag); return $this; }