Discussion in 'Plugin Development' started by xELI7E_SNIPEZx, Mar 9, 2014.

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


    I don't quite get the API for this event, so how would i cancel dragging an item out of their inventory into like a chest for example. I want them to be able to drag the item round their inventory just not into a chest. I've already sorted the drop events etc. It's just the DragEvent.
  2. Offline


    post code.
  3. Offline


    You only can seperate between inventory, chast inventory, funace inventory, ...
    Try this:
    2. // Doc: [url][/url]
    3. // ! Untested code
    4. // Use an eventlistener
    5. @EventHandler
    6. public void onDrag(InventoryDragEvent event) {
    7. if (event.getInventory().geType() == InventoryType.CHEST) {
    8. event.setCanceled(true);
    9. }
    10. }
    11. // There are more way to do it, and ways of doing it better, I think you should read the doc on the 'result' of the InventoryDragEvent
Thread Status:
Not open for further replies.

Share This Page