Try with if (player.getInventory().firstEmpty() == -1) { player.sendMessage("Inventory is full"); return true; }
elementalgodz11 Try: Code:java if (player.getInventory().firstEmpty() == -1){//Inv is full} else {player.getInventory().setItem(player.getInventory().firstEmpty(), YOUR_ITEM_HERE);} and put that anywhere you will be doing: Code:java player.getInventory().setItem(player.getInventory.firstEmpty(), itemstack);
He could also use: Code:java Player p = e.getPlayer();if (p.getInventory().firstEmpty() == -1){ return false; }
elementalgodz11 Not sure if anyone noticed this before but the image of the stack trace says that the error is being thrown from your player listener on PlayerDeathEvent, however, you posted code from your onCommand event. The error is being thrown from line 146 of your Player listener class. Please post the entire method, not just line 146.