CommandItemParser 5.46.0
Parses item arguments of commands: PocketMine's item names (StringToItemParser), the vanilla Bedrock item IDs the server supports (with or without "minecraft:", e.g. white_terracotta or cut_copper, which have no item name of their own) and legacy IDs (e.g. 35:14).
Methods
getVanillaIds()
php
public static function getVanillaIds() : arrayVanilla item IDs (without minecraft:) of every item type the server can create from a name, sorted. All of them are accepted by parse().
parse()
php
public static function parse(string $input) : \pocketmine\item\ItemwithData()
php
public static function withData(\pocketmine\item\Item $item, int $data) : ?\pocketmine\item\ItemApplies a Bedrock data value (the [data] argument of /give and /clear, e.g. the potion type) to the item, like vanilla does for items whose ID takes metadata. Returns null if the item has no variant with that data value. Data 0 and block items are returned unchanged.
