$pickaxe = new \pocketmine\item\Item(Item::DIAMOND_PICKAXE);
$pickaxe = new \pocketmine\item\Item(Item::IRON_PICKAXE, 0, 1);
$item = $player->getInventory()->getItemInHand(); if($item instanceof \pocketmine\item\Item && $item->isPickaxe()) { // Code for when the item is a pickaxe }This checks if the item in the player's hand is a pickaxe. The package library for the Item isPickaxe class is PocketMine-MP.