Keeping an item from being put into an inventory slot?

Discussion in 'Plugin Development' started by kdude63, Oct 25, 2012.

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

    kdude63

    So I'm trying to make it to where unless they have a permission, they can't put a specific armor on.
    So far, I've been able to use this, but it only partially works.
    It fires the event when the slot has the something, such as the disallowed armor, already in it. Rendering it effectively useless. I mean, other than that everything works fine. I just need the event to fire when someone places something INTO the armor slot.

    Here's what I have so far:
    Code:
        @EventHandler
        public void onInventory(InventoryClickEvent event)
        {
            if (event.getSlotType() == SlotType.ARMOR)
                checkArmor((Player)event.getWhoClicked());
        }
     
  2. Offline

    kdude63

    So I guess my question is "How do I get it to fire when someone places a specific item into a specific inventory slot, instead of moving or removing the item?"
     
Thread Status:
Not open for further replies.

Share This Page