public function hasRepairCost() : bool { if (!$this->hasCompoundTag()) { return false; } $tag = $this->getNamedTag(); if (isset($tag->RepairCost)) { $tag = $tag->RepairCost; if ($tag instanceof IntTag) { return true; } } return false; }