Maybe you can do it this way: PHP: $empty = $inventory->firstEmpty();if($empty === -1){//Inventory is full}else{//$empty is the first slot which is empty} Notice: I havent tested it
That will fail is the player's inventory is filled with... let's say steak (x64) but one of the slots has steak (x1). But most importantly, why do you want to check if the player's inventory is full?
so there is something to warn them that their inventory is full and their mining won't be a waste if their inventory is full
You can use canAddItem() where $item is the item you want to add. That function will check for item count and do all the required math. PHP: if($player->getInventory()->canAddItem($item)){ //not full}else{ //full}