Hello guys, im trying to update my code to api 4.0.0 but im stucking at getName of Enchantment by ID in new api PHP: public static $vanilla_enchant = [], $vanilla_options = [];public function onEnable(): void{ for ($i = 0; $i <= 36; $i++) { $enchantment = EnchantmentIdMap::getInstance()->fromId((int)$i); self::$vanilla_enchant[] = $enchantment; self::$vanilla_options[] = new MenuOption("⚫ ".$enchantment->getName()." ⚫"); }} Error: "Object of class pocketmine\lang\Translatable could not be converted to string" Thanks guys
PHP: public static $vanilla_enchant = [], $vanilla_options = [];public function onEnable(): void{ for ($i = 0; $i <= 36; $i++) { $enchantment = EnchantmentIdMap::getInstance()->fromId((int)$i); self::$vanilla_enchant[] = $enchantment; $name = $enchantment->getName(); if($name instanceof \pocketmine\lang\Translatable) $name = $name->getText(); self::$vanilla_options[] = new MenuOption("⚫ ".$name." ⚫"); }} You're welcome.