I want to get the id of the item from the item name. For example, the sign says Stone. I want to get the id of this item by pulling this text from the sign. i make SignShop. how can I do?
You can use the ItemFactory static function FromString() to get the Item's Id. Example accepted formats: diamond_pickaxe:5 minecraft:string 351:4 (lapis lazuli ID:meta) If multiple item instances are to be created, their identifiers must be comma-separated, for example: diamond_pickaxe,wooden_shovel:18,iron_ingot Example: PHP: pocketmine\item\ItemFactory::fromString("minecraft:diamond_pickaxe")->getId() // Get's the item then get's the item's id.
but this can cause some problems. I don't want it to say "diamond_pickaxe" on the sign. I want it to say "Diamond Pickaxe" so Line0 - [SignShop] Line1 - Diamond Pickaxe Line2 - 1 Piece Line3 - 100 Dolars I want it that way