Skip to content

Callback: open

Misat11 edited this page May 11, 2020 · 3 revisions

open (Groovy only)

This callback is called when someone opens gui or subgui. This callback is cancellable so you can check, if it's canceled or cancel it. When it's canceled, the inventory will just close. Can be used just globally, you can't register it to an item. These callbacks are called while OpenInventoryEvent is called.

inventory {
   open {
     player.sendMessage 'Welcome in this beautiful inventory'
   }

   item ('STONE')
   item ('GRAVEL') {
     item('DIRT')
   }
}

All methods available inside open can be found here

Clone this wiki locally