getNBT(); return $nbt->getString("CustomName") ?? $this->getDefaultName(); } /** * @param string $name */ public function setName(string $name) : void{ $nbt = $this->getNBT(); if($name === ""){ $nbt->removeTag("CustomName"); return; } $nbt->setString("CustomName", $name); } /** * @return bool */ public function hasName() : bool{ return $this->getNBT()->hasTag("CustomName"); } }