1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Solved getClientId Error

Discussion in 'Development' started by KHAV, Jun 9, 2018.

  1. KHAV

    KHAV Baby Zombie

    Messages:
    152
    GitHub:
    xkhhv
    I have this error that when i try to run my command:
    Code:
    [01:44:59] [Server thread/CRITICAL]: Unhandled exception executing command 'timepardon popoojkg' in timepardon: Call to undefined method pocketmine\OfflinePlayer::getClientId()
    [01:44:59] [Server thread/CRITICAL]: Error: "Call to undefined method pocketmine\OfflinePlayer::getClientId()" (EXCEPTION) in "TBan/src/TBan/Main" at line 155
    [01:44:59] [Server thread/DEBUG]: #0 src/pocketmine/command/PluginCommand(58): TimeBan\Main->onCommand(muqsit\hats\HatPlayer object, pocketmine\command\PluginCommand object, string timepardon, array Array())
    [01:44:59] [Server thread/DEBUG]: #1 src/pocketmine/command/SimpleCommandMap(258): pocketmine\command\PluginCommand->execute(muqsit\hats\HatPlayer object, string timepardon, array Array())
    [01:44:59] [Server thread/DEBUG]: #2 src/pocketmine/Server(1946): pocketmine\command\SimpleCommandMap->dispatch(muqsit\hats\HatPlayer object, string timepardon popoojkg)
    [01:44:59] [Server thread/DEBUG]: #3 src/pocketmine/Player(2190): pocketmine\Server->dispatchCommand(muqsit\hats\HatPlayer object, string timepardon popoojkg)
    [01:44:59] [Server thread/DEBUG]: #4 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(222): pocketmine\Player->chat(string /timepardon popoojkg)
    [01:44:59] [Server thread/DEBUG]: #5 src/pocketmine/network/mcpe/protocol/CommandRequestPacket(54): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleCommandRequest(pocketmine\network\mcpe\protocol\CommandRequestPacket object)
    [01:44:59] [Server thread/DEBUG]: #6 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(92): pocketmine\network\mcpe\protocol\CommandRequestPacket->handle(pocketmine\network\mcpe\PlayerNetworkSessionAdapter object)
    [01:44:59] [Server thread/DEBUG]: #7 src/pocketmine/network/mcpe/protocol/BatchPacket(114): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(pocketmine\network\mcpe\protocol\CommandRequestPacket object)
    [01:44:59] [Server thread/DEBUG]: #8 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(92): pocketmine\network\mcpe\protocol\BatchPacket->handle(pocketmine\network\mcpe\PlayerNetworkSessionAdapter object)
    [01:44:59] [Server thread/DEBUG]: #9 src/pocketmine/Player(3038): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(pocketmine\network\mcpe\protocol\BatchPacket object)
    [01:44:59] [Server thread/DEBUG]: #10 src/pocketmine/network/mcpe/RakLibInterface(153): pocketmine\Player->handleDataPacket(pocketmine\network\mcpe\protocol\BatchPacket object)
    [01:44:59] [Server thread/DEBUG]: #11 vendor/pocketmine/raklib/server/ServerHandler(98): pocketmine\network\mcpe\RakLibInterface->handleEncapsulated(string 192.168.100.5 57534, raklib\protocol\EncapsulatedPacket object, integer 0)
    [01:44:59] [Server thread/DEBUG]: #12 src/pocketmine/network/mcpe/RakLibInterface(94): raklib\server\ServerHandler->handlePacket()
    [01:44:59] [Server thread/DEBUG]: #13 src/pocketmine/network/Network(89): pocketmine\network\mcpe\RakLibInterface->process()
    [01:44:59] [Server thread/DEBUG]: #14 src/pocketmine/Server(2495): pocketmine\network\Network->processInterfaces()
    [01:44:59] [Server thread/DEBUG]: #15 src/pocketmine/Server(2243): pocketmine\Server->tick()
    [01:44:59] [Server thread/DEBUG]: #16 src/pocketmine/Server(2119): pocketmine\Server->tickProcessor()
    [01:44:59] [Server thread/DEBUG]: #17 src/pocketmine/Server(1701): pocketmine\Server->start()
    [01:44:59] [Server thread/DEBUG]: #18 src/pocketmine/PocketMine(305): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string C:\Users\khale\Desktop\PocketMine-MP\, string C:\Users\khale\Desktop\PocketMine-MP\plugins\)
    [01:44:59] [Server thread/DEBUG]: #19 C:/Users/khale/Desktop/PocketMine-MP/PocketMine-MP.phar(1): require(string phar://C:/Users/khale/Desktop/PocketMine-MP/PocketMine-MP.phar/src/pocketmine/PocketMine.php)
    
    
    This is my code:
    PHP:
    $player $this->getServer()->getOfflinePlayer($name);
    $player_name $player->getName();
    $player_client_id $player->getClientId();
     
  2. LewBr

    LewBr Zombie

    Messages:
    385
    GitHub:
    lewbr
    that means that you can't get a ClientId of a player that is Offline :confused:
     
  3. KHAV

    KHAV Baby Zombie

    Messages:
    152
    GitHub:
    xkhhv
    Oh xD
     
  4. Awzaw

    Awzaw Zombie Pigman Poggit Admin

    Messages:
    726
    GitHub:
    awzaw
    Please mark as "Solved" so staff don't waste time reading threads that no longer need an answer.
     
  5. KHAV

    KHAV Baby Zombie

    Messages:
    152
    GitHub:
    xkhhv
    Ok sorry
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.