When I do this: PHP: public function onTransaction(InventoryTransactionEvent $event){ $trans = $event->getTransaction()->getTransactions(); foreach($trans as $t){ $inv = $event->getTransaction()->getInventories(); foreach($inv as $i){ $chest = $i->getHolder(); if($chest instanceof Chest){ $event->setCancelled(true); } if($chest instanceof Player){ $event->setCancelled(true); } } } } About every third click you still get the item into the inventory
Flavius12 of EvolSoft has created a nice plugin called ChestLocker. Its not updated to the latest api as of now, but i have access to the repo and i will update and submit to poggit.!