Is there any way to get inventory before item was moved in InventoryMoveItemEvent event?

Discussion in 'Spigot Plugin Development' started by Msql, May 15, 2016.

  1. Is there any way to get inventory before item was moved in InventoryMoveItemEvent event?
    Or is there any way to get location of block/entity, where that event was happened?
    I need it a lot to prevent hopper move items when hopper is under chest if chest contains item that is "lock" in 1st slot.
    Thanks for any help :p
     
  2. The answer was methot getHolder() in Inventory.class :)
    Then we can getLocation() from holder and get block or entity in this location.
    Hope it will help someone like me :p
     
  3. or use the InventoryClickEvent then check location that way.
     
  4. Just by the way, you should set the prefix of this thread to "Solved". Just wanted to remind you! ;)