Plugins do not register

Discussion in 'Plugin Development' started by klosjaarrr, Oct 9, 2014.

Thread Status:
Not open for further replies.
  1. Offline


    Hey all... It seems I'm forgetting a simple step to make my plugins work again (Maven project), since the plugins do not load. I made a TestPlugin to test it out, and the same problem occurs. I have the following files:
    1. import java.util.logging.Logger;
    3. import org.bukkit.command.Command;
    4. import org.bukkit.command.CommandSender;
    5. import org.bukkit.entity.Player;
    6. import;
    9. public class TestPlugin extends JavaPlugin {
    11. public static TestPlugin instance;
    12. public final static Logger log = Logger.getLogger("Minecraft");
    14. @Override
    15. public void onEnable() {
    16. TestPlugin.instance = this;
    17. getLogger().info("TestPlugin has been enabled!");
    18. }
    20. @Override
    21. public void onDisable() {
    22. getLogger().info("TestPlugin has been disabled!");
    23. }
    25. @Override
    26. public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    28. if (!cmd.getName().equalsIgnoreCase("test")) {
    29. return false;
    30. }
    32. if (!(sender instanceof Player)) {
    33. sender.sendMessage("This command can only be executed by players.");
    34. return true;
    35. }
    37. Player player = (Player) sender;
    38. player.sendMessage("It is alive :o");
    40. return true;
    42. }
    44. }

    <project xmlns="" xmlns:xsi="" xsi:schemaLocation="">
    name: TestTitles
    main: com.kevinvoorn.testplugin
    version: 1.0.0
    description: Allows me to test this plugin
    author: klosjaarrr
            usage: /<command>
            description: Tests if the command works
            description: Grants access to /test
    What am I doing wrong? I update the project just before compiling it as a JAR file, still nothing seems to work.
  2. Offline


    I do not know why, but for some reason bukkit uses maven now? i think this is because you can no longer download bukkit from You can however still download it from a torrent (i do not support that) but its an option. andyou could just add the craftbukkit.jar to the configuration build (like we had to do before maven). maybe that will help.
    also you could just try to make it simpler with just:
    if (cmd.getName().equalsIgnoreCase("test")) {
    Player p = (Player) sender;
    p.sendMessage("WEll this will show you if it works...");
  3. Offline


    klosjaarrr Any errors on startup? Also:
    • Don't use the Minecraft Logger, use the Logger you get from JavaPlugin's getLogger() method.
    • Remove that static plugin instance.
    • No need for enable/disable messages, Bukkit does this for you.
    Klumel8 Make sure that you check if sender instanceof Player before casting.
  4. Offline


    Klumel8 The use of Maven isn't related at all to the DMCA. Using Maven has always been an option, and Bukkit & CraftBukkit have always been built with Maven. Well, I say always, there was a time before Maven but essentially always. :)
  5. Offline


    I looked in the server logs, but it doesn't show up at all: It's like its not in the plugin folder (but I am sure it is). I've tried to do the things you suggested, but it still doesn't work. It seems to be a Maven issue, as it worked before I used Maven. Any idea what else I could do?
  6. Offline


    klosjaarrr of it's in the plugins folder and it is a .jar file, then Bukkit should attempt to load it (which means there should be anything about it in the last server log)
  7. Offline


    Ok so I looked again, apparently I have my plugin.yml in the wrong folder (as it cannot be found). Any idea where I should put it? Currently I have it in my src/main/resources (Maven project).

    [13:30:49] [Server thread/ERROR]: Could not load 'plugins/TestPlugin.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at ~[spigot_1649.jar:git-Spigot-1649]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins( [spigot_1649.jar:git-Spigot-1649]
        at org.bukkit.craftbukkit.v1_7_R4.CraftServer.loadPlugins( [spigot_1649.jar:git-Spigot-1649]
        at net.minecraft.server.v1_7_R4.DedicatedServer.init( [spigot_1649.jar:git-Spigot-1649]
        at [spigot_1649.jar:git-Spigot-1649]
        at [spigot_1649.jar:git-Spigot-1649]
    Caused by: Jar does not contain plugin.yml
        ... 6 more

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 14, 2016
  8. Offline


    klosjaarrr you forgot to add plugin.yml to the jar (or you forgot to add it during the export if you use Eclipse, afaik Netbeans and IntelliJ would add it automatically)
  9. Offline


    I tell Maven in the pom file to include plugin.yml and config.yml from the resources folder, with IntelliJ.
  10. Offline


    Gnat008 for me it happens automatically with resources located at src/main/resources/ ;3
  11. Offline


    I did not forget to add it during the export, will try adding it manually to the pom.xml. It is still weird, as it seems to work for others. I'm not really in favour of changing to another IDE as I'm quite used to Eclipse :) thanks for the help anyway, will try a couple of the suggestions above and let you know if it worked or not :)
  12. Offline


    You can make sure the jar has it by opening its contents. It may vary from OS but there is probably something along the lines of "Open Archive". When you export, make sure you have the plugin.yml selected and "Export generated class files and resources" checked
Thread Status:
Not open for further replies.

Share This Page