PHP: public function onInteract(PlayerInteractEvent $event) : void{ $player = $event->getPlayer(); $block = $event->getBlock(); if($block->getId() === 54 && $block->getDamage() === 100){ $player->sendMessage("hi"); } }
Try this PHP: public function onInteract(PlayerInteractEvent $event) : void{ $player = $event->getPlayer(); $block = $event->getBlock(); var_dump($block->getDamage()); } And post the dump
Just as i thought, the damage doesn't save on items that don't use that damage. You will have to put nbt on the item, and check the nbt