i copy paste a Code from a bedwars plugin but want to know what is what PHP: public function onTransaction(InventoryTransactionEvent $event) { $trans = $event->getTransaction()->getTransactions(); $int = $event->getTransaction()->getInventories(); $isChest = false; $isPlayer = false; $player; $chestNew; $realTrans; foreach ($trans as $t) { foreach ($int as $chest) { if (!($chest instanceof ChestInventory) && !($chest instanceof PlayerInventory)) { return; } $chest = $chest->getHolder(); if ($chest instanceof Chest) { $chestNew = $chest->getBlock(); $isChest = true; $realTrans = $t; } if ($chest instanceof Player) { $player = $chest; $isPlayer = true; } } } if ($isPlayer == true && $isChest == true) {$mainChest = $player->getLevel()->getTile($chestNew);if($mainChest instanceof Chest){$realItemTrans = $realTrans->getTargetItem(); //item das gehandelt wird$inventoryTrans = $mainChest->getInventory();$itemTransID = $realTrans->getTargetItem()->getId();if($itemTransID == 2){foreach ($this->getServer()->getLevelByName("LobbyBW")->getPlayers() as $player) {$player->sendMessage($this->prefix . "InventoryTransactionEvent works !");$this->getLogger()->info($this->prefix . "InventoryTransactionEvent works !");}}}}} by the way ist dont work but i want that if the Player grab a item from the chest that he opens a new chest but dont know how and how i can get the player
First, why do you copy a part of my Code? Second, if you copy, you need to understand what you did, and I see, you don't(there are mistakes in the code). Third, copying isn't coding - Learn PHP and the Pocketmine API and build your way up, instead of copying other Plugins/Codes.
I know there is a mistake because i wantto understand what the event does , but with you sentences "copy my code bla" i dont know what that is xD it works with other code but i copy paste and dont know what is what so i Ask again ... What variable is what and what does this do? -> If($ItemTrans % 2 ==0){} ? What is %
Sigh... Just study PHP at codeacademy first. If you don't want to, then you are not worthy enough to be here.