$maxsize = $event->getPlayer()->getInventory()->getMaxStackSize(); $size = $event->getPlayer()->getInventory()->getSize(); if($size > $maxsize){ $event->getPlayer()->addTitle("Full ! Clean you inventory!"); $event->getPlayer()->getLevel()->addSound(new AnvilFallSound($event->getPlayer()->getLocation())); why the event doesn't work when people inventory is full and next they're mining
Ok so you want the plugin to announce to the player that they need to clear their inventory? do you want it in a pop up message or chat message?
You're complicating yourself, here's how I'd do it : - Listen to blockbreakevent -get the item dropped by the block - check if you can add the item in the player inventory (using API : https://github.com/pmmp/PocketMine-...c/pocketmine/inventory/BaseInventory.php#L255 ), if not send the message / popup.