Solved Devtools invalid name of plugin

Discussion in 'Plugin Help' started by BlueWhaleYT, Dec 6, 2019.

  1. BlueWhaleYT

    BlueWhaleYT Spider Jockey

    Messages:
    33
    GitHub:
    bluewhaleyt
    Hi there,
    I did a simple plugin by watching tutorials.
    I installed DevTools plugin into my server.
    I know I need to type /makeplugin {pluginname}

    After I typed /makeplugin Welcome,it shows an error message "Invalid plugin name,check the name case in the console."

    However, doesn't my plugin named Welcome??..

    Thanks.
     

    Attached Files:

  2. Gianluxx

    Gianluxx Slime

    Messages:
    96
    GitHub:
    Gianluxx
    Your plugin is a mess. Main.php should be in the src/bluewhaleyt folder. And in the plugin.yml you need to put a : after the command text
     
  3. BlueWhaleYT

    BlueWhaleYT Spider Jockey

    Messages:
    33
    GitHub:
    bluewhaleyt
    what do mean add "a:"?can u elaborate or take a screenshot for a look?
     
  4. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,053
    GitHub:
    HimbeersaftLP
    A colon, this symbol:
    Code:
    :
    
     
  5. BlueWhaleYT

    BlueWhaleYT Spider Jockey

    Messages:
    33
    GitHub:
    bluewhaleyt
    Iknow,where should I put in.
    Do I need to create a new line or not
    Do you mean this
     

    Attached Files:

  6. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,053
    GitHub:
    HimbeersaftLP
    Code:
    commands:
      text:
        description: "Stop sending screenshots and just paste the fucking text"
      cure:
        description: "It's a pain in the ass to read and copy"
    
     
  7. BlueWhaleYT

    BlueWhaleYT Spider Jockey

    Messages:
    33
    GitHub:
    bluewhaleyt
    ParseError: "syntax error, unexpected 'public' (T_PUBLIC), expecting '{'" (EXCEPTION) in "plugins/Welcome/src/BlueWhaleYT/Main" at line 13 [14:23:13] [Server thread/DEBUG]: #0 (): BaseClassLoader->loadClass(string[16] BlueWhaleYT\Main) [14:23:13] [Server thread/DEBUG]: #1 (): spl_autoload_call(string[16] BlueWhaleYT\Main) [14:23:13] [Server thread/DEBUG]: #2 src/pocketmine/plugin/PluginManager(180): class_exists(string[16] BlueWhaleYT\Main, boolean 1) [14:23:13] [Server thread/DEBUG]: #3 src/pocketmine/plugin/PluginManager(351): pocketmine\plugin\PluginManager->loadPlugin(string[49] /storage/emulated/0/PocketMine-MP/plugins/Welcome, array[1]) [14:23:13] [Server thread/DEBUG]: #4 plugins/PocketMine-DevTools (1).phar/src/DevTools/DevTools(71): pocketmine\plugin\PluginManager->loadPlugins(string[42] /storage/emulated/0/PocketMine-MP/plugins/, array[1]) [14:23:13] [Server thread/DEBUG]: #5 src/pocketmine/plugin/PluginBase(123): DevTools\DevTools->onEnable() [14:23:13] [Server thread/DEBUG]: #6 src/pocketmine/plugin/PluginManager(580): pocketmine\plugin\PluginBase->setEnabled(boolean 1) [14:23:13] [Server thread/DEBUG]: #7 src/pocketmine/Server(2008): pocketmine\plugin\PluginManager->enablePlugin(object DevTools\DevTools) [14:23:13] [Server thread/DEBUG]: #8 src/pocketmine/Server(1994): pocketmine\Server->enablePlugin(object DevTools\DevTools) [14:23:13] [Server thread/DEBUG]: #9 src/pocketmine/Server(2077): pocketmine\Server->enablePlugins(integer 0) [14:23:13] [Server thread/DEBUG]: #10 src/pocketmine/command/defaults/ReloadCommand(49): pocketmine\Server->reload() [14:23:13] [Server thread/DEBUG]: #11 src/pocketmine/command/SimpleCommandMap(270): pocketmine\command\defaults\ReloadCommand->execute(object pocketmine\command\ConsoleCommandSender, string[6] reload, array[0]) [14:23:13] [Server thread/DEBUG]: #12 src/pocketmine/Server(2035): pocketmine\command\SimpleCommandMap->dispatch(object pocketmine\command\ConsoleCommandSender, string[6] reload) [14:23:13] [Server thread/DEBUG]: #13 src/pocketmine/Server(1622): pocketmine\Server->dispatchCommand(object pocketmine\command\ConsoleCommandSender, string[6] reload) [14:23:13] [Server thread/DEBUG]: #14 vendor/pocketmine/snooze/src/SleeperHandler(123): pocketmine\Server->pocketmine\{closure}() [14:23:13] [Server thread/DEBUG]: #15 vendor/pocketmine/snooze/src/SleeperHandler(85): pocketmine\snooze\SleeperHandler->processNotifications() [14:23:13] [Server thread/DEBUG]: #16 src/pocketmine/Server(2355): pocketmine\snooze\SleeperHandler->sleepUntil(double 1575728592.8462) [14:23:13] [Server thread/DEBUG]: #17 src/pocketmine/Server(2212): pocketmine\Server->tickProcessor() [14:23:13] [Server thread/DEBUG]: #18 src/pocketmine/Server(1790): pocketmine\Server->start() [14:23:13] [Server thread/DEBUG]: #19 src/pocketmine/PocketMine(275): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[34] /storage/emulated/0/PocketMine-MP/, string[42] /storage/emulated/0/PocketMine-MP/plugins/) [14:23:13] [Server thread/DEBUG]: #20 src/pocketmine/PocketMine(299): pocketmine\server() [14:23:13] [Server thread/DEBUG]: #21 (1): require(string[89] phar:///storage/emulated/0/PocketMine-MP/PocketMine-MP.phar/src/pocketmine/Pocke)

    then devtools closed.
     
  8. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,053
    GitHub:
    HimbeersaftLP
    There's a syntax error in your main file, check for missing semicolons (;) and curly braces ({ and })
     
  9. BlueWhaleYT

    BlueWhaleYT Spider Jockey

    Messages:
    33
    GitHub:
    bluewhaleyt
     

    Attached Files:

  10. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,053
    GitHub:
    HimbeersaftLP
    In plugin.yml change
    Code:
    main: BlueWhaleYT\Main
    
    to
    Code:
    main: BlueWhaleYT\Welcome\Main
    
    Change your folder structure so that "src/BlueWhaleYT" contains a folder called "Welcome" in which your main.php goes.

    Change the namespace in Main.php from "namespace Welcome;" to "namespace BlueWhaleYT\Welcome;"
     
  11. BlueWhaleYT

    BlueWhaleYT Spider Jockey

    Messages:
    33
    GitHub:
    bluewhaleyt
    everything is done,but I confuse what you said.
     
  12. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,053
    GitHub:
    HimbeersaftLP
    Move Main.php from "src/BlueWhaleYT" to "src/BlueWhaleYT/Welcome", that way your plugin has the namespace "BlueWhaleYT\Welcome" and not just "BlueWhaleYT".
    This is the recommended practise by PQRS, rule C1a: https://poggit.pmmp.io/rules.edit
     
  13. BlueWhaleYT

    BlueWhaleYT Spider Jockey

    Messages:
    33
    GitHub:
    bluewhaleyt
    so the main.php is near to the plugin.yml?
     
  14. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,053
    GitHub:
    HimbeersaftLP
    No, like this:
    Code:
    Plugin Folder
    │   plugin.yml
    └───src
        └───BlueWhaleYT
            └───Welcome
                    Main.php
    
     
  15. BlueWhaleYT

    BlueWhaleYT Spider Jockey

    Messages:
    33
    GitHub:
    bluewhaleyt
    the problem is Welcome Folder is includes src,BlueWhaleYT,main.php and plugin.yml,isn't it? how I drag it there.
     
  16. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,053
    GitHub:
    HimbeersaftLP
     
  17. BlueWhaleYT

    BlueWhaleYT Spider Jockey

    Messages:
    33
    GitHub:
    bluewhaleyt
     

    Attached Files:

  18. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,053
    GitHub:
    HimbeersaftLP
    Please click on the image I sent above, it's a video
     
  19. BlueWhaleYT

    BlueWhaleYT Spider Jockey

    Messages:
    33
    GitHub:
    bluewhaleyt
    are the src/BlueWhaleYT/Welcome is created by yourself ?That's mean I need to create a empty folder named Welcome?
     
  20. HimbeersaftLP

    HimbeersaftLP Fish

    Messages:
    2,053
    GitHub:
    HimbeersaftLP
    Yes
     

Share This Page

  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.