How do I remove an Item from Inventory?

Discussion in 'Plugin Development' started by apexearth, Jan 13, 2011.

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

    apexearth

    Using Bukkit, how can I remove an item from inventory?

    Do I have to set an item stack quantity to zero?
    Do I have to set an item stack material type to air?

    I don't see anything having to do with removing an item stack from inventory.

    Any pointers would be fantastic, hopefully my eyes aren't just averting from an obvious answer! :)
     
  2. Offline

    lostaris

    Ive been playing around with this issue as well. Ive tried both myself, setting an item stack to have its quantity be zero leaves one item, and type to air crashes the client.
     
  3. Offline

    Krammeh

  4. Offline

    Ben S

    I've been unable to remove items too. I've tried just about everything I can think of.
     
  5. Offline

    feverdream

    Inventory hooks have not been added to bucket yet, or so I am told.
     
  6. Offline

    Ben S

    Well it's not so much an inventory hook, but an item modification. You are unable to set the amount to 0. But you can change the amount, so I am pretty sure this is a bug.
     
  7. Offline

    feverdream

    Not really. A stack of items Zero in size seems like a bug to me. Why not just remove the items stack from the collection in order to remove it from the inventory?
     
  8. Offline

    apexearth

    Perhaps they made the minimum 1 because they intend on giving the users the ability to completely remove the ItemStack. If thats the case, then it's not a bug, and they just didn't add the feature yet. That's all hypothetical though.

    --ps, what he said.
     
Thread Status:
Not open for further replies.

Share This Page