Remove single item from inventory

Discussion in 'Plugin Development' started by Zarkopafilis, Jun 11, 2014.

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

    Zarkopafilis

    Inventory.removeItem(ItemStack); Removed ALL items....
    I need to remove only a single item!

    ==I have included updateInventory method==

    P.S.

    ItemStack.setAmount(30); gives me 2 of the item and I dont know why thats happening when im adding to the inventory
     
  2. Offline

    fireblast709

  3. Offline

    Zarkopafilis

  4. Offline

    indyetoile

    Code:java
    1. ItemStack is = new ItemStack(Material_STONE, 1);
    2. Inventory.removeItem(is);
    3. p.UpdateInventory();


    Define the amount in your itemstack.
     
  5. Offline

    Garris0n

    removeItem() does not remove all items matching, it simply removes any items you provide it.
    remove() does remove all items matching.
     
    sumsar1812 and lenis0012 like this.
  6. Offline

    Zarkopafilis

    It doesnt work....I have tried...
     
Thread Status:
Not open for further replies.

Share This Page