Solved Click event acting weird.

Discussion in 'Plugin Development' started by spurkle, Nov 15, 2014.

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

    spurkle

    Hey. I have 'default' items that player doesn't drop on death or can't put anywhere. BUT for some reason player can put the items in one of custom inventories & regular chests. Code to prevent putting looks like this:


    Code:
            if (e.getInventory().getHolder() instanceof Player) {
                if (e.getSlot() == 8 || e.getSlot() == 7)
                    e.setCancelled(true);
            }
    Help would be much appreciated. thanks.

    EDIT: Nvm, thats me being dumb lol. Didn't notice 'get holder' statement.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
Thread Status:
Not open for further replies.

Share This Page