PHP: public function onTap (PlayerInteractEvent $event){$player=$event->getPlayer();$menu = InvMenu::create(InvMenu::TYPE_CHEST);$menu->getInventory()->setContents([ Item::get(Item::DIAMOND_SWORD), Item::get(Item::DIAMOND_PICKAXE)]);$menu->readonly();$menu->send($player);} I read the InvMenu doc and readOnly() is supposed to stop players from taking items from the chest but i could still take items from the chest
In that case, Have you registered the InvMenuHandler? Are you using the up-to-date version of InvMenu?
no i havent registered InvMenuHandler. my goal is only to show players inside the chest. and yes im using up-to-date version of InvMenu
You will still need to register the InvMenuHandler. There's no way for InvMenu to register an event listeners without a helping hand from a plugin. It needs to register it's InventoryTransactionEvent.
This was previously not the case, but due to inaccuracies, it became mandatory to register the InvMenuHandler even for readonly.