-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Description
When I try to open an inventory with the latest version of invMenu, the inventory opens but after a few seconds, the inventory closes by itself without any action from the player...
Here is the code i use:
$inv = InvMenu::create(InvMenuTypeIds::TYPE_DOUBLE_CHEST);
$inv->getInventory()->setContents($player->getInventory()->getContents());
$inv->setListener(InvMenu::readonly());
for ($i = 36; $i < $inv->getInventory()->getSize(); $i++) {
$inv->getInventory()->setItem($i, VanillaBlocks::STAINED_GLASS_PANE()->setColor(DyeColor::RED())->asItem());
}
$inv->getInventory()->setItem(47, $player->getArmorInventory()->getHelmet());
$inv->getInventory()->setItem(48, $player->getArmorInventory()->getChestplate());
$inv->getInventory()->setItem(50, $player->getArmorInventory()->getLeggings());
$inv->getInventory()->setItem(51, $player->getArmorInventory()->getBoots());
$inv->send($player);
Metadata
Metadata
Assignees
Labels
No labels