Hey Modder , i was testing PlayerInteractEvent i tried to teleport player when he taps Trapdoor PHP: public function PlayerInteractEvent(PlayerInteractEvent $e){$block = $e->getBlock();if($block == "Trapdoor"){$this->getLogger()->info("1. Worked!");}else{$this->getLogger()->info("2. Worked");{} Should i use "==" or "==="? Main question: It always runs 2., Why ?
How do I make so that if a player from the trunk takes the item ID under 50 and the subject remained in the chest and he wrote that you cannot take this course?
PHP: $event->getTransaction()->getInventories(); This should return an array of two (or more) inventories. In the case of from chest inventory to player inventory, it should have one ChestInventory instance and one PlayerInventory instance.
I had experience working with InventoryTransactionEvent months ago too, but that plugin never got finished. I recommend you to look at the PocketMine source code to use it correctly.