Solved get what is in slot from inventory

Discussion in 'Plugin Development' started by Cat 700, Mar 15, 2020.

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

    Cat 700

    I want to get the inventory from InventoryClickEvent (that would be event.getClickedInventory()) and from that inventory I want to get what is in specific slots
     
  2. Offline

    bowlerguy66

    Code:
            event.getInventory().getItem(event.getSlot())
    
     
  3. Offline

    Cat 700

    @bowlerguy66 no I want to get the whole inventory slots so I want to get what is in slot 20 21 23 24 25 and other slots not just the clicked slot nvm I see your code it would just be the slots that I want then instead of event.getslot
     
    Last edited: Mar 15, 2020
  4. Offline

    bowlerguy66

    Ok... (inventory).getItem(slot#) will return an ItemStack, you can check what you want from there.

    Can I recommend trying to research these things for yourself a little bit harder? I've just quickly googled "How to get an item from an inventory slot number bukkit" and I got at least 3 resources that would have answered your question

    Edit: src1 src2 src3
     
    Wick likes this.
Thread Status:
Not open for further replies.

Share This Page