Hello can somebody help me ? I have this error in 2 Plugins since 2 Days, I asked in Discord but nobody can helpsme, hope you can guys thx. Here the complete Error: [Server thread/CRITICAL]: ArgumentCountError: "Too few arguments to function pocketmine\Server::getPlayer(), 0 passed in /home/minecraft/plugins/rewardPlugin/src/SpongeBoZZ/rewardPlugin/Main.php on line 25 and exactly 1 expected" (EXCEPTION) in "src/pocketmine/Server" at line 794 Here ist the Code: <?php declare(strict_types=1); namespace SpongeBoZZ\rewardPlugin; use pocketmine\command\Command; use pocketmine\command\CommandSender; use pocketmine\plugin\PluginBase; class Main extends PluginBase{ public $listOfCoolDown = []; public function onEnable() { $this->getLogger()->warning("Plugin aktiviert"); } public function onCommand(CommandSender $sender, Command $command, string $label, array $args): bool { switch ($command->getName()) { case "reward": if (!isset($this->listOfCoolDown[$sender->getName()])) { $this->listOfCoolDown[$sender->getName()] = time() + 60; $sender->sendMessage("Du wirst deine Belohnung erhalten !"); } else { if (time() < $this->listOfCoolDown[$sender->getName()]) { $remaining = $this->listOfCoolDown[$sender->getName()] - time(); $sender->sendPopup("Countdown: " . $remaining); } else{ unset($this->listOfCoolDown[$sender->getName()]); } } break; } return true; } public function onDisable() { $this->getLogger()->warning("Plugin deaktiviert !"); } }
The error says what its supposw to say you are not passing in arguments that its expecting to the function.
Too few arguments to function pocketmine\Server::getPlayer(), 0 passed in /home/minecraft/plugins/rewardPlugin/src/SpongeBoZZ/rewardPlugin/Main.php on line 25 and exactly 1 expected Did you read the error before making this post?