For some reason, this code doesn't do anything. No internal error nor does it do anything. How do I fix it? Thats the code -> public function onInventoryTransaction(InventoryTransactionEvent $event) : void{ $transaction = $event->getTransaction(); $player = $transaction->getSource(); $inv = $player->getInventory(); if (count($actions) === 2) { $actions = array_values($transaction->getActions()); foreach ($actions as $i => $action) { $item = Item::get(373, 0, 1); $eye = Item::get(351, 0, 1); $stick = Item::get(280, 0, 1); if ($action instanceof SlotChangeAction && ($otherAction = $actions[($i + 1) % 2]) instanceof SlotChangeAction && ($itemClickedWith = $action->getTargetItem())->getId() === $eye && ($itemClicked = $action->getSourceItem())->getId() !== ItemIds::AIR) { $player->sendMessage("Unable to craft this item"); $mergeSuccessful = false; if ($itemClicked == $eye) { $inv->removeItem($item); $action->getInventory()->setItem($action->getSlot(), $stick); $player->sendMessage("§7(§a!§7) §aYou have crafted an awkward potion"); $mergeSuccessful = true; } if ($mergeSuccessful) { $event->setCancelled(); $otherAction->getInventory()->setItem($otherAction->getSlot(), Item::get(Item::AIR)); } } } } }