Because the code, I got from the people from the first thread was called on null, so I am reopening this thread. So how I do that?
PHP: public function TapItemsInChest(InventoryTransactionEvent $event){ foreach($event->getTransaction()->getTransactions() as $t){ $inv = $t->getInventory(); if($inv instanceof PlayerInventory){ $player = $inv->getHolder(); }elseif($inv instanceof ChestInventory){ $chest = $inv->getHolder(); } } }
Does it really work on your plugin? Because as I did it, it said Player on null... Thats why I reopened this thread, see, or is it that I am to stupid to script? :/ https://forums.pocketmine.net/threads/how-to-get-the-player-on-inventorytransactionevent.14003/