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

Solved How to send Command as Console in Plugin?

Discussion in 'Plugin Help' started by AlexPads, Oct 28, 2018.

  1. AlexPads

    AlexPads Spider Jockey

    Messages:
    27
    GitHub:
    alexpads
    PHP:
    $this->getServer()->dispatchCommand(new ConsoleCommandSender(), "");

    That is as far as i have gotten but it throws this error

    PHP:
    [Server thread/CRITICAL]: Error"Class 'AlexPads\ShopUI\TinyPixelDevz\ConsoleCommandSender' not found" (EXCEPTIONin "ShopUI-For-Real/src/AlexPads/ShopUI/TinyPixelDevz/Shop" at line 319
    [18:42:10] [Server thread/DEBUG]: #0 FormAPI (3).phar/src/jojoe77777/FormAPI/Form(46): AlexPads\ShopUI\TinyPixelDevz\Shop->AlexPads\ShopUI\TinyPixelDevz\{closure}(pocketmine\Player object, integer 0)
    [18:42:10] [Server thread/DEBUG]: #1 src/pocketmine/Player(3389): jojoe77777\FormAPI\Form->handleResponse(pocketmine\Player object, integer 0)
    [18:42:10] [Server thread/DEBUG]: #2 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(246): pocketmine\Player->onFormSubmit(integer 1, integer 0)
    [18:42:10] [Server thread/DEBUG]: #3 src/pocketmine/network/mcpe/protocol/ModalFormResponsePacket(49): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleModalFormResponse(pocketmine\network\mcpe\protocol\ModalFormResponsePacket object)
    [18:42:10] [Server thread/DEBUG]: #4 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(96): pocketmine\network\mcpe\protocol\ModalFormResponsePacket->handle(pocketmine\network\mcpe\PlayerNetworkSessionAdapter object)
    [18:42:10] [Server thread/DEBUG]: #5 src/pocketmine/network/mcpe/protocol/BatchPacket(114): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(pocketmine\network\mcpe\protocol\ModalFormResponsePacket object)
    [18:42:10] [Server thread/DEBUG]: #6 src/pocketmine/network/mcpe/PlayerNetworkSessionAdapter(96): pocketmine\network\mcpe\protocol\BatchPacket->handle(pocketmine\network\mcpe\PlayerNetworkSessionAdapter object)
    [18:42:10] [Server thread/DEBUG]: #7 src/pocketmine/Player(3056): pocketmine\network\mcpe\PlayerNetworkSessionAdapter->handleDataPacket(pocketmine\network\mcpe\protocol\BatchPacket object)
    [18:42:10] [Server thread/DEBUG]: #8 src/pocketmine/network/mcpe/RakLibInterface(161): pocketmine\Player->handleDataPacket(pocketmine\network\mcpe\protocol\BatchPacket object)
    [18:42:10] [Server thread/DEBUG]: #9 vendor/pocketmine/raklib/src/server/ServerHandler(98): pocketmine\network\mcpe\RakLibInterface->handleEncapsulated(string 192.168.86.1 56610, raklib\protocol\EncapsulatedPacket object, integer 0)
    [18:42:10] [Server thread/DEBUG]: #10 src/pocketmine/network/mcpe/RakLibInterface(102): raklib\server\ServerHandler->handlePacket()
    [18:42:10] [Server thread/DEBUG]: #11 src/pocketmine/network/Network(94): pocketmine\network\mcpe\RakLibInterface->process()
    [18:42:10] [Server thread/DEBUG]: #12 src/pocketmine/network/mcpe/RakLibInterface(92): pocketmine\network\Network->processInterface(pocketmine\network\mcpe\RakLibInterface object)
    [18:42:10] [Server thread/DEBUG]: #13 vendor/pocketmine/snooze/src/SleeperHandler(120): pocketmine\network\mcpe\RakLibInterface->pocketmine\network\mcpe\{closure}()
    [18:42:10] [Server thread/DEBUG]: #14 vendor/pocketmine/snooze/src/SleeperHandler(82): pocketmine\snooze\SleeperHandler->processNotifications()
    [18:42:10] [Server thread/DEBUG]: #15 src/pocketmine/Server(2259): pocketmine\snooze\SleeperHandler->sleepUntil(double 1540770130.565)
    [18:42:10] [Server thread/DEBUG]: #16 src/pocketmine/Server(2134): pocketmine\Server->tickProcessor()
    [18:42:10] [Server thread/DEBUG]: #17 src/pocketmine/Server(1700): pocketmine\Server->start()
    [18:42:10] [Server thread/DEBUG]: #18 src/pocketmine/PocketMine(249): pocketmine\Server->__construct(BaseClassLoader object, pocketmine\utils\MainLogger object, string C:\Users\nickv\Desktop\entire servre 2\, string C:\Users\nickv\Desktop\entire servre 2\plugins\)
    [18:42:10] [Server thread/DEBUG]: #19 C:/Users/nickv/Desktop/entire servre 2/PocketMine-MP.phar(1): require(string phar://C:/Users/nickv/Desktop/entire servre 2/PocketMine-MP.phar/src/pocketmine/PocketMine.php)
    [18:42:10] [RakLibServer thread/NOTICE]: Blocked 192.168.86.1 for 5 seconds
     
  2. SOFe

    SOFe Administrator Staff Member PMMP Team Poggit Admin

    Messages:
    1,968
    GitHub:
    sof3
    PHP:
    use pocketmine\command\ConsoleCommandSender;
     
    AlexPads and HimbeersaftLP like this.
  3. Primus

    Primus Zombie Pigman

    Messages:
    749
    PHP:
    \pocketmine\command\ConsoleCommandSender
    You were just a tick faster.
     
    AlexPads and HimbeersaftLP like this.
  4. AlexPads

    AlexPads Spider Jockey

    Messages:
    27
    GitHub:
    alexpads
    @SOFe @Primus Thank you i didn't realize that i had not Done that yet Sorry to bother you all :)
     
  5. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    Np I got you.
     
  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.