Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Plugin isn't being loaded

Comments in 'Plugin Development' started by CraftYourBukkit, Nov 29, 2015.

  1. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Okay so, I made a plugin and it somehow doesn't load it. It does not show anything in the console on startup(no error, no message from the plugin, etc.) and when doing /plugins, it's red.
    My plugin.yml:
    Code:
    name: TheDropper
    main: TheDropper\Main
    version: 1.0.0
    api: 1.1.0
    commands:
        td:
            usage: /td <addarena/regsign> <worldname> <amount/[line1]> [line2]
            description: Basic command
            permission: TheDropper.command
    My Main.php(only onEnable() because of others would copy it):
    PHP:
    <?php

    namespace TheDropper;

    use 
    pocketmine\plugin\PluginBase;
    use 
    pocketmine\event\Listener;
    use 
    pocketmine\command\CommandSender;
    use 
    pocketmine\command\Command;
    use 
    pocketmine\event\player\PlayerInteractEvent;
    use 
    pocketmine\tile\Sign;
    use 
    pocketmine\level\Position;
    use 
    pocketmine\utils\TextFormat;
    use 
    pocketmine\Player;
    use 
    pocketmine\level\Level;
    use 
    pocketmine\event\player\PlayerMoveEvent;
    use 
    pocketmine\block\Block;
    use 
    pocketmine\event\entity\EntityDamageEvent;

    class 
    Main extends PluginBase implements Listener {

        public 
    $mode 0;
        public 
    $signregister false;
        public 
    $levelname "";
        public 
    $line1 "";
        public 
    $line2 "";
        public 
    $spawnCount 0;

        public function 
    onEnable() {
            @
    mkdir($this->getDataFolder());
            
    $this->saveDefaultConfig();
            
    $this->reloadConfig();
            
    $this->getLogger()->info("┬žaAktiviert");
            
    $this->getServer()->getPluginManager()->registerEvents($this$this);
        }
    }
    It should be something wrong in there, because the startup won't work, so I guess the error isn't in onCommand etc.
    Tho, I don't find an error.. What could be wrong? :/
  2. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    Make sure you have DevTools, before you do anything.
    In the console, does it say somthing like "Loading TheDropper..." or "Enabling TheDropper..." when starting up?
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Show the startup logs.
  4. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    I have DevTools.
    It doesn't show anything of the plugin. Other plugins from source do work.
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Check if you defined the source folder and plugin.yml correctly. Especially that you have the plugin.yml file.
  6. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    I did..
  7. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
  8. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    send a screenshot of your startup.
  9. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    I checked the logs and not the console and I am getting this error:
    Code:
    RuntimeException: "yaml_parse(): end of stream reached without finding document 0" (E_WARNING) in "/src/pocketmine/utils/Config" at line 143
    But the config is there..
  10. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    That error means the file doesnt exist. Can you post the code of when you created the config, and how you are trying to get info from it?
  11. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    The config does exist, the plugin is loaded from source and has the config inside. Also doesn't work when loading as phar and the created config.
    PHP:
    $this->getConfig();
  12. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Doesn't "resources" has to be outside of "src"? Well, doesn't work either way.
  13. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    [​IMG]
  14. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Doesn't work too :/
  15. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    Everything seems normal...Idk why it isnt loading.
    Do your other source plugins load?
  16. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Yes.
  17. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    The Problem is the config file, it doesn't find it.
  18. HotFireyDeath
    Offline

    HotFireyDeath Notable Member Plugin Developer

    Joined:
    Mar 19, 2015
    Posts:
    328
    Plugins:
    1
    Minecraft User:
    HotFireyDeath
    Does the config have missing data; is the file empty?
  19. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    Yes, it is empty. Tho, it doesn't get anything out of it, so that shouldn't be the problem
    cake23 likes this.
  20. CraftYourBukkit
    Offline

    CraftYourBukkit Notable Member Plugin Developer

    Joined:
    Jan 20, 2015
    Posts:
    1,022
    Plugins:
    2
    Minecraft User:
    CraftYourBukkit
    For everyone that has the same problem, and don't know why: You cannot save an empty file. There has to be something in the file, that fixed the error for me.
    HotFireyDeath likes this.

Share This Page

Advertisement