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

"__construct" Error

Discussion in 'Requests' started by RJoLe, Mar 3, 2021.

  1. RJoLe

    RJoLe Creeper

    Messages:
    5
    This Is The Error She Given On The Panel :

    HTML:
    [Server thread/CRITICAL]: ArgumentCountError: "Too few arguments to function Kit\AnaKomut::__construct(), 0 passed in E:\PocketMine-MP By.OwnKronos\plugins\WarZKit\src\Kit\Main.php on line 19 and exactly 1 expected" (EXCEPTION) in "plugins/WarZKit/src/Kit/AnaKomut" at line 18
    [Server thread/CRITICAL]: #0 plugins/WarZKit/src/Kit/Main(19): Kit\AnaKomut->__construct()
    [Server thread/CRITICAL]: #1 src/pocketmine/plugin/PluginBase(116): Kit\Main->onEnable()
    [Server thread/CRITICAL]: #2 src/pocketmine/plugin/PluginManager(552): pocketmine\plugin\PluginBase->setEnabled(boolean 1)
    [Server thread/CRITICAL]: #3 src/pocketmine/Server(1787): pocketmine\plugin\PluginManager->enablePlugin(object Kit\Main)
    [Server thread/CRITICAL]: #4 src/pocketmine/Server(1773): pocketmine\Server->enablePlugin(object Kit\Main)
    [Server thread/CRITICAL]: #5 src/pocketmine/Server(1586): pocketmine\Server->enablePlugins(integer 1)
    [Server thread/CRITICAL]: #6 src/pocketmine/PocketMine(273): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[50] E:\PocketMine-MP By.OwnKronos\, string[58] E:\PocketMine-MP By.OwnKronos\plugins\)
    [Server thread/CRITICAL]: #7 src/pocketmine/PocketMine(304): pocketmine\server()
    [Server thread/CRITICAL]: #8 (11): require(string[105] phar://E:/PocketMine-MP By.OwnKronos/PocketMine-MP.phar/src/)
    ---Code line inside the plugin:
    PHP:
    <?php

    namespace Kit;

    use 
    pocketmine\{Player ,Server};
    use 
    pocketmine\command\{CommandCommandSenderConsoleCommandSender};
    use 
    pocketmine\event\Listener;
    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\utils\Config;

    use 
    Kit\Main;
    use 
    Kit\AnaForm;

    class 
    AnaKomut extends Command{

        private 
    $loader;

        public function 
    __construct(Main $loader) {
            
    $this->loader $loader;
            
    parent::__construct(
                
    'kit',
                
    'Kit Menusunu Acar',
                
    'Kullanimi : /kit...',
            );
        }

        public function 
    execute(CommandSender $senderstring $label, array $args): bool{

            
    $form = new AnaForm;
            
    $form->AnaForm($sender);
            return 
    true;

        }

    }

    ?>
    I will be glad if you help me
     
  2. DavyCraft648

    DavyCraft648 Spider Jockey

    Messages:
    40
    GitHub:
    DavyCraft648
    Code:
    ArgumentCountError: "Too few arguments to function Kit\AnaKomut::__construct(), 0 passed in E:\PocketMine-MP By.OwnKronos\plugins\WarZKit\src\Kit\Main.php on line 19 and exactly 1 expected" (EXCEPTION) in "plugins/WarZKit/src/Kit/AnaKomut" at line 18
    
    Read it carefully, Main.php on line 19

    and if you want to get help about your plugins, go to Development Thread instead
     
    Last edited: Mar 3, 2021
  3. RJoLe

    RJoLe Creeper

    Messages:
    5
    Ow My bad thank 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.