Plugin Help Error Could not load 'plugins/plugin.jar' in folder 'plugins'

Discussion in 'Plugin Help/Development/Requests' started by AmericanRedBird, Aug 1, 2016.

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

    AmericanRedBird

    Hello,

    I have recently been learning how to create Java 1.8 Bukkit Plugins using Java Eclipse. While I am creating a plugin, everything is okay, but while I upload the plugin.jar to my server's plugins folder and start my server, I always get a message in the CONSOLE saying:

    Error Could not load 'plugins/(plugin_name).jar' in folder 'plugins'

    For those who have knowledge of this error, here is the CONSOLE log. http://imgur.com/a/3JziG

    Here is a link from my Eclipse: http://imgur.com/a/72ZFi

    Here is my plugin.yml text:
    Code:
    name: Help
    
    version: 1.0
    
    main: com.americanredbird.dev.main
    
    description: Help Command!
    
    
    
    commands:
    
    help:
    
    description: Help Command
    
    usage: /help
    
    Thank you for reading and if you know how to fix this error please inform me using the comments.
     
  2. Online

    timtower Administrator Administrator Moderator

  3. Offline

    AmericanRedBird

  4. Online

    timtower Administrator Administrator Moderator

    @AmericanRedBird Please post your new plugin.yml using code blocks:
    [code] < yml or code here > [/code]
     
  5. Offline

    AmericanRedBird

    @timtower
    Code:
    name: Help
    version: 1.0
    main: com.americanredbird.dev.main
    description: Help Command!
    
    commands:
       help:
        description: Help Command
          usage: /help
    
     
  6. Online

    timtower Administrator Administrator Moderator

    @AmericanRedBird The usage is wrongly indented, it needs to be in line with description.
     
  7. @AmericanRedBird Like this
    Code:
    commands:
      acommand:
        description: Some description
        usage: This is optional
        aliases: [This, is, also, optional]
     
  8. Offline

    AmericanRedBird

    @timtower

    The plugin is now loading in correctly, thank you! Just another small question, as I execute the command /help in my CONSOLE, all that I receive is INFO /help. Is there something incorrect about my Commands.java class?
     
  9. Online

    timtower Administrator Administrator Moderator

  10. Offline

    AmericanRedBird

    Code:
    package com.americanredbird.dev.commands;
    
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    
    public class Commands implements CommandExecutor{
    
    @Override
    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] a) {
    Player p = (Player) sender;
    p.sendMessage("&6&lPlease message an online staff member for assistance.");
    return false;
    }
    
    }
     
  11. Online

    timtower Administrator Administrator Moderator

    @AmericanRedBird You are casting to a player before you check if it is a player.
    And if the command ran successfully then you need to return true.
     
  12. Offline

    AmericanRedBird

    @timtower Changed, although through CONSOLE, the same issue is occurring. "INFO /help"
     
  13. Online

    timtower Administrator Administrator Moderator

  14. Offline

    AmericanRedBird

    Code:
     
    package com.americanredbird.dev;
    
    import java.util.logging.Logger;
    
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class Main extends JavaPlugin {
     
     public Logger logger = Logger.getLogger("Minecraft");
     
     public void onEnable() {
     PluginDescriptionFile pdffile = getDescription();
     logger.info(pdffile.getName() + "Has been enabled! Version: " + pdffile.getVersion());
     }
    
     public void onDisable() {
     PluginDescriptionFile pdffile = getDescription();
     logger.info(pdffile.getName() + "Has been disabled!");
     }
    }
    
    This is my Main.java code.

    Here is my Commands.java code:

    Code:
    [LIST=1]
    [*]
    
    [*]package com.americanredbird.dev.commands;
    [*]
    
    [*]import org.bukkit.command.Command;
    [*]import org.bukkit.command.CommandExecutor;
    [*]import org.bukkit.command.CommandSender;
    [*]import org.bukkit.entity.Player;
    [*]
    
    [*]public class Commands implements CommandExecutor{
    [*]
    
    [*]@Override
    [*]public boolean onCommand(CommandSender sender, Command cmd, String label, String[] a) {
    [*]Player p = (Player) sender;
    [*]p.sendMessage("&6&lPlease message an online staff member for assistance.");
    [*]return false;
    [*]}
    [*]
    
    [*]}
    [/LIST]
    [LIST=1]
    
    [/LIST]
     
  15. Online

    timtower Administrator Administrator Moderator

    @AmericanRedBird Still casting without checking, still returning false, and no need for those loggers, Bukkit does that for you.
     
  16. Offline

    AmericanRedBird

    @timtower I have fixed everything, and the plugin is now working. Thank you for your support, and have a good day/night.
     
  17. @AmericanRedBird Just a tip to help you in your development. Don't learn from TheBCBroz. Remove the onEnable and onDisable messages Bukkit does it for you, remove the logger and remove onDisable since it is unused.
     
Thread Status:
Not open for further replies.

Share This Page