A PocketMine-MP virion to create and manage virtual inventories!
InvMenu::getListener()
, InvMenu::getInventoryCloseListener()
.
This allows developers to retrieve the current listener, extend its behavior, and then re-set it.
This provides more flexibility in chaining or extending listener functionalities without losing the original behavior.
$listener = $menu->getInventoryCloseListener();
$menu->setInventoryCloseListener(function(Player $player, Inventory $inventory) use($listener) : void{
$listener($player, $inventory);
// place additional inventory close checks here
});