Wasn't the only issue but I did figure it out but now when I send the message it gives me this error Code: Error: "Call to a member function sendMessage() on null" (EXCEPTION) in "/plugins/ApocalypseCore_v0.1BETA/src/RoyalMCPE/ApocalypseCore/Events/WeeklyRewardEvents" at line 35
PHP: public function onTransaction(InventoryTransactionEvent $e) { $transactions = $e->getTransaction ()->getTransactions (); $player = null; $hopperinv = null; $action = null; foreach ( $transactions as $transaction ) { if (($inv = $transaction->getInventory ()) instanceof HopperInventory) { foreach ( $inv->getViewers () as $assumed ) if ($assumed instanceof Player) { $player = $assumed; $hopperinv = $inv; } } $action = $transaction; } $e->setCancelled (); $item = $action->getTargetItem (); if ($item->getName () === "Test") { $player->sendMessage ( "Test" ); } }