In this code I'm trying to get the ClientID of the sender of the command PHP: public function onCommand(CommandSender $sender, Command $command, $label, array $args){switch($command->getName()){case "test":$clientID = $sender->getClientID();$sender->sendMessage("Your Client ID is: " . $clientID);} But this error shows in console when running the command Code: [20:18:49] [Server thread/INFO]: An unknown error occurred while attempting to perform this command [20:18:49] [Server thread/CRITICAL]: Unhandled exception executing command 'test': Call to undefined method pocketmine\command\ConsoleCommandSender::getClientID() [20:18:49] [Server thread/CRITICAL]: Error: "Call to undefined method pocketmine\command\ConsoleCommandSender::getClientID()" (EXCEPTION) in "/plugins/Test/TestPlugin/Main" at line 313 Please help.
You forget to check for instance of Player PHP: //not exact DO NOT COPYif ($sender instanceof Player) $sender->sendMessage("Your Client ID is: " . $sender->getClientID()); else $sender->sendMessage("Client ID not available") i probably could shorten it with shorthands