Check if an Item is at it's max stack size

Discussion in 'Plugin Development' started by Acer_Mortem, Apr 19, 2014.

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

    Acer_Mortem

    How could I check if an Item is at it's max stack size? This would include 1 max size for things like swords.
     
  2. Offline

    Seadragon91

    The class ItemStack has a method named getMaxStackSize it will return the right number for the item, sword = 1, signs = 16, stone = 64.
     
  3. Offline

    adam753

    You need ItemStack.getMaxStackSize().
     
  4. Offline

    Captain Dory

    PHP:
    public void onClick(InventoryClickEvent e) {
     
      if (
    e.getCurrentItem().getMaxStackSize() == e.getCurrentItem().getAmount()) {
     
          
    // do something
          
    return;
     
      }
     
    }
     
Thread Status:
Not open for further replies.

Share This Page