Hello, want to know why it doesn't send my message. Code: PHP: public function sendTest(Player $sender, $player = null) { $playerOb = $sender->getServer()->getPlayer($player); if ($playerOb instanceof Player) { $sender->sendArgsMessage(TextFormat::GRAY . "---- {0}'s Coin ----", $playerObject->getName()); foreach($playerOb->getAllTest() as $test) {// This one $sender->sendMessage(TextFormat::GRAY . $test->getKit()->getName() . ": " . TextFormat::GOLD . $test->getTest()); }
This is really a PHP question, not pocketmine... When you use '$anyobject->function()', the function must be accessible in that object, but you have several that are not. Use an IDE, include pocketmine source code, and you'll get help for this kind of problem as you type.
Hello, i rename all the functions and objects so that my plugin will not be leaked, $test->getTest(); is just a renamed version of $elo->getElo(); getElo() is defined in another file which is accessible by using: use di21\Elo\basefiles\elo
We can't guess what the rest of your code looks like, but I doubt that your Player object has a function called getAllTest(). Unless you post the actual code we can't help much, so either you keep it to yourself and fix it yourself, or you share the code and the community helps.