How do I check if a player has a clear inventory?
I'm making a PvP arena plugin but I need it so when someone types /pvp join, it checks if they have a clear inventory. If they do have a clear inventory, it lets them join, if they don't, it asks them to.
I tried this but it's not reliable as there are more slots:
if(p.getInventory().getArmorContents() == null
&& p.getInventory().getItemInHand() == null
&& p.getInventory().getItemInHand() == null) {
Then I tried this but it did not work:
if (p.getInventory().getContents().length == 0) {
