Solved How to make return items from chest?

Discussion in 'Plugin Development' started by makcoh2018, Jul 14, 2021.

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

    makcoh2018

    Hey, i need to return items when player close the chest. For example: if player put some items in the chest and close the chest than need to return these items.
     
  2. Offline

    KarimAKL

    @makcoh2018
    • Listen to the InventoryCloseEvent.
    • Get the upper inventory using InventoryEvent#getInventory().
    • Get the inventory's holder.
    • Check if the inventory's holder is an instance of org.bukkit.block.Chest.
     
    makcoh2018 likes this.
  3. Offline

    makcoh2018

    @KarimAKL
    Thanks!
     
    Last edited: Jul 14, 2021
    KarimAKL likes this.
Thread Status:
Not open for further replies.

Share This Page