Solved plugin.yml main reference help

Discussion in 'Plugin Development' started by Garfield100, Oct 3, 2015.

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

    Garfield100

    So I made a test plugin that will just whisper something to the player when he/she types /test.
    The only problem I have is that when I try to load the plugin into the server, I get this:

    Code:
    [19:49:20] [Server thread/ERROR]: Could not load 'plugins/BukkitPlayerTimer.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    Now as far as I know, I messed up the "main:" part of the plugin.yml.
    The project is called BukkitPlayerTimer, the package is called com.Garfield100 and the class is called Main.java.
    The plugin.yml is located in the main project folder. These are its contents:

    Code:
    name: BukkitPlayerTimer
    version: 1.0
    author: Garfield100
    main: com.Garfield100.Main
    commands:
        test:
            description: Just a test
    Now, as far as I know I only Need "name:", "version:" and "main:" , although I might be wrong. Anyways, the way I understood the "main:" thing is package name+class name that extends JavaPlugin.

    Please help, as this looks like something very easy to solve, which just makes it that much more frustrating.

    Regards,
    Garfield100

    P.S.: If you need the source code or something else, just ask, I'll attatch it.
     
  2. Offline

    I Al Istannen

    @Garfield100 Could you post the whole error? The things that come behind "Invalid plugin.yml" specify the error more detailed.
     
  3. Offline

    SuperSniper

    @Garfield100 Show us your Main class please, so we can see the Main class name, and the package name. "Invalid plugin.yml" errors are mostly from the "main:" being incorrect, but it's also possible that other things are causing it from the plugin.yml.
     
  4. Offline

    RoboticPlayer

    @Garfield100 Change your package name, you don't own the domain garfield100.com (I checked, it doesn't exist). Instead, use something such as your email address, github subdomain, or me.(yourname).(projectname)
     
  5. Offline

    Garfield100

    Code:
    [19:55:01] [Server thread/ERROR]: Could not load 'plugins/BukkitPlayerTimer.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:160) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.craftbukkit.v1_7_R3.CraftServer.loadPlugins(CraftServer.java:355) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.craftbukkit.v1_7_R3.CraftServer.reload(CraftServer.java:797) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.Bukkit.reload(Bukkit.java:288) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:23) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:180) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchCommand(CraftServer.java:701) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.PlayerConnection.handleCommand(PlayerConnection.java:956) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.PlayerConnection.a(PlayerConnection.java:817) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.PacketPlayInChat.a(PacketPlayInChat.java:28) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.PacketPlayInChat.handle(PacketPlayInChat.java:47) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.NetworkManager.a(NetworkManager.java:157) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.ServerConnection.c(SourceFile:134) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.v(MinecraftServer.java:667) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:260) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.u(MinecraftServer.java:558) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:469) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token; found character  '\t' that cannot start any token
    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:358) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:179) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:591) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:161) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:146) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:133) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:237) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:123) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:106) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:121) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:480) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.yaml.snakeyaml.Yaml.load(Yaml.java:411) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:232) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:155) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    ... 18 more
    This first one is a few hours old though.
    Here's a newer one:


    Code:
    [19:49:20] [Server thread/ERROR]: Could not load 'plugins/BukkitPlayerTimer.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:160) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.loadPlugins(CraftServer.java:355) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.<init>(CraftServer.java:317) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.PlayerList.<init>(PlayerList.java:68) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedPlayerList.<init>(SourceFile:14) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedServer.init(DedicatedServer.java:126) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:436) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token; found character     '\t' that cannot start any token
        at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:358) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:179) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:591) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:161) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:146) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:133) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:237) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:123) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:106) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:121) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:480) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.Yaml.load(Yaml.java:411) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:232) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:155) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        ... 8 more
    Thanks, I tried that before, then changed to com since I saw that in many videos. None of them worked. Just to be sure I retried right now, still no success though :(

    View attachment 25382

    Here's a snapshot after I changed com to me (Still doesn't work)
    If you also want the Main class source code, just ask!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 30, 2015
  6. Offline

    oceantheskatr

    Have you made sure to refresh your project? Right-click "BukkitPlayerTimer" folder and click refresh THEN export it after.
     
  7. Offline

    Garfield100

    Just tried that. The problem persists :/
    Still, thank you, it's probably a good habit to have!
     
  8. Offline

    RoboticPlayer

    A) I doubt that it would be an issue in the actual code, but it is possible. Could you provide it?
    B) Just for future reference, please follow Java Naming Conventions. Package names should be all lowercase (also be sure to include a unique identifier within your package, such as the project name), and it's best not to use "Main" as the name of your main class (use something like the name of the project).
     
  9. Offline

    Garfield100

    For A)


    Code:
    package me.garfield.bukkitplayertimer;
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class BukkitPlayerTimer extends JavaPlugin{
      
        public void onEnable() {
          
            getLogger().info("Player Timer Enabled!");
        }
      
        public void onDisable() {
            getLogger().info("Player Timer Disabled!");
        }
      
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
            if(sender instanceof Player) {
                Player player = (Player) sender;
                if(cmd.getName().equalsIgnoreCase("test")){
                    String test = "tell "+player.getName()+" Hello there, "+player.getName()+", Garfield100's plugin seems to be working!";
                    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), test);
                    player.sendMessage(ChatColor.GOLD + "Hope you recieved the test!");
                }
              
            }
            return false;
        }
      
    }
    

    For B)

    Thank you for pointing that out! I adjusted everything, now it looks like this:
    upload_2015-10-4_12-25-5.png

    The plugin is just supposed to whisper a message to the player that executed it and then "sendMessage" another one to him. Later on it's supposed to time the players time on the server and warn him after 30 mins on week days and after 1h on weekends, with a few more details here and there.

    Also, is it normal that next to "+Quote" and "Reply" it sais "Tahg User" instead of "Tag User"?
    If it is, why so?
     
  10. Offline

    RoboticPlayer

    Ok, so a couple of adjustments can be made to your Main class.
    A) onEnable, onDisable, and onCommand can all be overridden
    B) There is no reason to log when the plugin is enabled and disabled, Bukkit already does this
    C) Due to part B, you don't need an onEnable or onDisable
    D) In your onCommand, you are checking if the sender is a player before casting, and that is good. However, what will you do if the sender is the console? You check it but you don't handle it
    E) Returning false in your onCommand says that it wasn't handled and will display the usage from your plugin.yml
    F) When does the error you provided appear? On server startup or when the player runs the command?
     
  11. Offline

    Garfield100

    A) What do you mean "can be overridden"?
    B/C) OK, Removed those
    D) I have no idea, I just took most of this from a video, so I don't know how to do that. Would that be sender instanceof Console?
    E) Ok, returned true;
    F) Just checked, it occurs on server startup. I checked the logs without even joining the server.
    Here is the error after the adjustments, just in case something changed:

    Code:
    [18:50:54] [Server thread/INFO]: Starting minecraft server version 1.7.9
    [18:50:54] [Server thread/INFO]: Loading properties
    [18:50:54] [Server thread/INFO]: Default game type: SURVIVAL
    [18:50:54] [Server thread/INFO]: Generating keypair
    [18:50:54] [Server thread/INFO]: Starting Minecraft server on 5.62.105.244:25565
    [18:50:54] [Server thread/INFO]: This server is running CraftBukkit version git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks (MC: 1.7.9) (Implementing API version 1.7.9-R0.2)
    [18:50:54] [Server thread/ERROR]: Could not load 'plugins/BukkitPlayerTimer.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:160) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.loadPlugins(CraftServer.java:355) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.<init>(CraftServer.java:317) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.PlayerList.<init>(PlayerList.java:68) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedPlayerList.<init>(SourceFile:14) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedServer.init(DedicatedServer.java:126) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:436) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token; found character     '\t' that cannot start any token
        at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:358) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:179) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:591) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:161) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:146) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:133) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:237) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:123) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:106) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:121) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:480) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.yaml.snakeyaml.Yaml.load(Yaml.java:411) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:232) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:155) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        ... 8 more
    Thanks for all the help :)

    I mainly learned programming with JavaScript and a bit of object-oriented Java at school. This is new to me...
     
  12. Offline

    oceantheskatr

    Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning for the next token; found character '\t' that cannot start any token

    Make sure you're not using any tabs, use spacebar for indenting!
     
  13. Offline

    Garfield100

    in the plugin.yml?
    Ok, I'll try!

    Edit: Nope, doesn't work :(
     
    Last edited: Oct 4, 2015
  14. Offline

    RoboticPlayer

    You can do
    Code:
    @Override
    public void onEnable() {
    }
    @Override
    public void onDisable() {
    }
    @Override
    public boolean onCommand(parameters) {
    }
    And you are sure that you never used the tab key in your plugin.yml?
     
  15. Offline

    I Al Istannen

    @Garfield100 You definitly used a tab in the plugin.yml. You should remove every intendation and make sure, you use just 2 spaces. If you do that, the error message should go away or change. On the screenshots, it looks like you used tabs infront of "test" and "description".
     
  16. Offline

    RoboticPlayer

    It doesn't have to be 2 spaces. I use 4 and it works just fine.
     
  17. Offline

    oceantheskatr

    I use three spaces for indentation :p as long as it's consistent then it doesn't matter.
     
  18. Offline

    Garfield100

    @I Al Istannen @henderry2019 @oceantheskatr

    Ok guys, I did what you told me and theres both good and bad news. The bad news is, it still doesn't work.
    The good news is, the error changed! (I suppose that's good? :D)

    As you can see, it now sais "commands are of wrong type".
    I have the feeling we're almost there!

    Code:
    [17:06:47] [Server thread/INFO]: This server is running CraftBukkit version git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks (MC: 1.7.9) (Implementing API version 1.7.9-R0.2)
    [17:06:47] [Server thread/ERROR]: Could not load 'plugins/BukkitPlayerTimer.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: commands are of wrong type
        at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:941) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:232) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:155) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.loadPlugins(CraftServer.java:355) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.<init>(CraftServer.java:317) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.PlayerList.<init>(PlayerList.java:68) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedPlayerList.<init>(SourceFile:14) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedServer.init(DedicatedServer.java:126) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:436) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
        at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:923) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        ... 10 more
     
  19. Offline

    Garfield100

    There you go:

    Code:
    name: BukkitPlayerTimer
    version: 1.0
    author: Garfield100
    main: me.garfield100.bukkitplayertimer.BukkitPlayerTimer
    commands:
      test:
      description: Just a test
     
  20. @Garfield100 Command format is incorrect.

    Code:
    commands:
      example:
        description: Example description
     
  21. Offline

    Garfield100

    Thanks! Now that error is gone, but sadly the cannot find main class error is back:
    EDIT: Actually, it's different! It's not "invalid plugin.yml", now it's just the main class!


    Code:
    [18:22:58] [Server thread/INFO]: This server is running CraftBukkit version git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks (MC: 1.7.9) (Implementing API version 1.7.9-R0.2)
    [18:22:58] [Server thread/ERROR]: Could not load 'plugins/BukkitPlayerTimer.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.garfield100.bukkitplayertimer.BukkitPlayerTimer'
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:42) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:127) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:328) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:251) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.loadPlugins(CraftServer.java:355) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.craftbukkit.v1_7_R3.CraftServer.<init>(CraftServer.java:317) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.PlayerList.<init>(PlayerList.java:68) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedPlayerList.<init>(SourceFile:14) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedServer.init(DedicatedServer.java:126) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.MinecraftServer.run(MinecraftServer.java:436) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.ThreadServerApplication.run(SourceFile:628) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
    Caused by: java.lang.ClassNotFoundException: me.garfield100.bukkitplayertimer.BukkitPlayerTimer
        at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_71]
        at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.7.0_71]
        at java.security.AccessController.doPrivileged(Native Method) ~[?:1.7.0_71]
        at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.7.0_71]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:77) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:62) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_71]
        at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.7.0_71]
        at java.lang.Class.forName0(Native Method) ~[?:1.7.0_71]
        at java.lang.Class.forName(Unknown Source) ~[?:1.7.0_71]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:40) ~[craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        ... 10 more
     
  22. Offline

    Garfield100

    I know, but how? What's wrong?

    upload_2015-10-5_18-38-27.png
     
  23. Online

    timtower Administrator Administrator Moderator

    @Garfield100 Well, in your package it is garfield, in your main garfield100
     
  24. Offline

    Garfield100

    ...
    I feel indescribably stupid. Let's see if it works now.

    YAYWVTVDA&^WDUATWDCYTRWAD&UTACWDAJYTWD
    YESSS
    THANK YOU GUYS

    Sorry...

    But seriously thank you so much! It works now! I'm just blind...

    Thank you so much again guys, I hope this helps anyone else!

    YESSSSSSSSSSSSS
    BEST COMMUNITY EVER

    Sincerely,
    Garfield100

    P.S.: You made my whole week.

    FAZIT:

    -DO NOT use tabs to indent the plugin.yml
    -MAKE REALLY SURE the package name and the class name are the same as in the plugin.yml


    EDIT by Timtower: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Oct 5, 2015
    oceantheskatr likes this.
  25. @Garfield100 Well that was a interesting post... Anyway, glad you finally got it sorted.
     
    oceantheskatr likes this.
Thread Status:
Not open for further replies.

Share This Page