Solved How do I add a inventory to a InventoryClickEvent

Discussion in 'Plugin Development' started by CaLxCyMru, Jun 28, 2013.

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

    CaLxCyMru

    Hello there, I'm having a little trouble with adding the inventory I want to negate the Item being removed from the inventory.

    Thanks in advance!
    -CaL
     
  2. Offline

    nbkburns

    CaLxCyMru

    Code:
    @EventHandler
        public void OnInventoryClick(InventoryClickEvent Event){
            if (Event.getInventory().getTitle().equals("YOURINVENTORYNAME")) {
                if(Event.getCurrentItem().getType() == Material.YOURMATERIAL){
                    Event.setCancelled(true);
                }
            }
    there you go
     
  3. Offline

    CaLxCyMru

Thread Status:
Not open for further replies.

Share This Page