[Solved]

Discussion in 'Plugin Development' started by -_Husky_-, Jul 15, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    -_Husky_-

  2. Offline

    kSafin

    There's many ways.

    I'd probably do it as so:

    PHP:
    Inventory inv player.getInventory();
     
    ItemStack[] contents inv.getContents();
     
    for (
    ItemStack i contents) {
        if (
    != null) {
          return 
    false;
        }
    }
     
    return 
    true;
    Just checks if every slot is null (empty), and if it encounters one that isn't empty (meaning the inventory isn't empty), it'll return false.

    Otherwise if it goes through all the slots and they're all null (empty), it'll return true, meaning yes, the whole inv is empty.
     
  3. Offline

    -_Husky_-

    Cheers, i got this. thanks ;3
     
Thread Status:
Not open for further replies.

Share This Page