Stop Players from getting item from inv?

Discussion in 'Plugin Development' started by ChipDev, Jan 1, 2016.

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

    ChipDev

    Hello everybody! Its been too long since I have posted in PD...
    I had a question, Im cancelling the inv click event in my plugin and it is working fine, though, in almost all servers you can "shift-click, then exit very fast" to put the item in your inventory.
    Some servers instantly remove the item, or make it non-usable or non-visible to others. How can I keep the items in the inventory no matter what?
     
  2. Offline

    87pen

    Inventory click event has a getClick() method that returns a ClickType does cancelling the Shift click ClickType specifically work?
     
  3. Offline

    ChipDev

    Let me try that!
    Ill get back later, I'm heading off to florida :cool:
     
  4. Offline

    Zombie_Striker

    @ChipDev
    Code:
       public void onclick(InventoryClickEvent e) {
         if(inventory == the inventory you're testing)
             if(e.isShiftClick())
               e.setCancelled(true);
        }
    
     
    Last edited: Jan 1, 2016
  5. Offline

    teej107

    Is it a "ghost" item? In the InventoryCloseEvent, update the inventory.
     
    ChipDev likes this.
  6. Offline

    ChipDev

    Exactly! I didn't know if I was going crazy or if these items were kinda ghostly...
    [air][glass][skeleton]
     
Thread Status:
Not open for further replies.

Share This Page