https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/inventory/PlayerInventory.php#L259 Example PHP: if($player->getInventory()->getHelmet()->getId() === Item::DIAMOND_HELMET) { //Do stuff}
I don't know... When do you need to check if they are wearing a diamond helmet? (Eg when a player gets hit by a player, when a player touches a block etc)
PHP: if($player->getInventory()->getHelmet()->getId() === Item::DIAMOND_HELMET) { //getHelmet() returns the helmet as an Item object, you check the id //Do stuff}
PHP: $item = $player->getInventory()->getHelmet();/*if($item->getId() === 0){ //Player doesn't have a helmet on.}*/$id = $item->getId();$meta = $item->getDamage();$name = $item->getName();$tags = $item->getNamedTag();