Help with InventoryMoveItemEvent

Discussion in 'Plugin Development' started by xigsag, Jun 16, 2014.

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

    xigsag

    I need help figuring out the events triggered when moving an item from one inventory to another, and how to cancel them.

    The InventoryMoveItemEvent doesn't work, or rather, I don't see any feedback from the event. Other events such as cancelling the PlayerDropItemEvent is being called properly, just not the InventoryMoveItemEvent.

    [​IMG]

    The InventoryClickEvent simply cancels:
    - Dropping by mousing over the item and pressing Q;
    - Shift-Clicking an item.
    - Swapping items by pressing a hotbar number (1~9), to make it swap with the item on your mouse cursor.

    I have tried doing:
    Code:java
    1. if (e.getSlotType() == SlotType.CONTAINER) {
    2. e.setCancelled(true);
    3. }


    , thinking that the upper inventory would be considered a container.

    Thanks in advance.
     
Thread Status:
Not open for further replies.

Share This Page