Closed ghost closed 4 years ago
Hi, I've coded this:
public function warpmenu(Player $player) { $menu = InvMenu::create(InvMenu::TYPE_DOUBLE_CHEST); $menu->readonly(); $menu->setName("§bSaerit"); $inventory = $menu->getInventory(); $menu->setListener(function(Player $player, Item $itemTakenOut, Item $itemPuttingIn, SlotChangeAction $action) : void { if ($itemTakenOut->getId() === Item::DIAMOND) { $player->sendMessage("Hello world!"); $player->removeWindow($action->getInventory()); } if ($itemTakenOut->getCustomName() === "§cClose the menu") { $player->sendMessage("yo"); } }); $inventory->setContents([ 13 => Item::get(Item::DIAMOND, 0, 1)->setCustomName("§bSpawn"), 45 => Item::get(Item::STAINED_GLASS, 14, 1)->setCustomName("§cClose the menu") ]); $menu->send($player); }
but in the moment I click the diamond, my game crash, if I click the glass dont crash. help
Yeah, this is a known issue in v1.16, you'll have to wait until pmmp fixes it (pmmp is already aware of the issue).
Hi, I've coded this:
but in the moment I click the diamond, my game crash, if I click the glass dont crash. help