What's wrong with my plugin.yml?

Discussion in 'Plugin Development' started by InkzzzMC, Dec 7, 2014.

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

    InkzzzMC

    Code:
    name: PluginsHider
    main: me.bukkit.Inkzzz.PluginsHider
    version: 1.1
    commands:
      ?:
          description: Shows you a the list of plugins.
          usage: /<command>
      pl:
          description: Shows you a the list of plugins.
          usage: /<command>
      plugins:
        description: Access to view all server plugins.
        permission: pluginhider.admin
        usage: /<command>
     
    permissions:
      pluginhider.admin:
        description: Allows you to see the server plugins
        default: false
    I get this error when the plugin tries to load:
    Code:
    [15:06:20] [Server thread/ERROR]: Could not load 'plugins\pluginhider.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 org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchServerCommand(CraftServer.java:688) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedServer.aB(DedicatedServer.java:296) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:261) [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.parser.ParserException: while parsing a block mapping; expected <block end>, but found BlockMappingStart
        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:575) ~[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.composeMappingNode(Composer.java:230) ~[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]
        ... 13 more
     
  2. InkzzzMC The spacing, remeber 2 spaces not 4.
     
  3. Offline

    InkzzzMC

    bwfcwalshy I edited it, but still have the error?


    Code:
    name: PluginsHider
    main: me.bukkit.Inkzzz.PluginsHider
    version: 1.1
    commands:
      ?:
        description: Shows you a the list of plugins.
        usage: /<command>
      pl:
        description: Shows you a the list of plugins.
        usage: /<command>
      plugins:
        description: Access to view all server plugins.
        permission: pluginhider.admin
        usage: /<command>
     
    permissions:
      pluginhider.admin:
        description: Allows you to see the server plugins.
        default: false
     
  4. Offline

    Avygeil

    InkzzzMC Copy-pasted both of them, and they both worked. Could it be wrongly exported/have a format error that is stripped when you copy paste it here?
     
  5. Offline

    InkzzzMC

    Avygeil

    I have no errors in my code:

    I then wen't and delete the plugin.yml file and re-wrote it the same, another error.....

    Code:
    [15:52:55] [Server thread/ERROR]: Could not load 'plugins\pluginhider.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 org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchServerCommand(CraftServer.java:688) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedServer.aB(DedicatedServer.java:296) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:261) [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.parser.ParserException: while parsing a block mapping; expected <block end>, but found BlockMappingStart
        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:575) ~[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.composeMappingNode(Composer.java:230) ~[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]
        ... 13 more
    [15:52:55] [Server thread/ERROR]: Could not load 'plugins\PluginHiders.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 org.bukkit.craftbukkit.v1_7_R3.CraftServer.dispatchServerCommand(CraftServer.java:688) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedServer.aB(DedicatedServer.java:296) [craftbukkit.jar:git-Bukkit-1.7.9-R0.1-10-g8688bd4-b3092jnks]
        at net.minecraft.server.v1_7_R3.DedicatedServer.v(DedicatedServer.java:261) [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.parser.ParserException: while parsing a block mapping; expected <block end>, but found BlockMappingStart
        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:575) ~[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.composeMappingNode(Composer.java:230) ~[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]
        ... 13 more
     
  6. Offline

    Avygeil

    InkzzzMC Yeah, but the plugin.yml you posted loads with no error for me. Also it's parsed valid here.That's strange because the stacktrace shows format error while I see none. Upload the raw jar/yml file somewhere so I can see it.
     
  7. Offline

    InkzzzMC

  8. Offline

    Avygeil

    InkzzzMC No, upload the raw plugin.yml or jar file because copying it here probably stripped an inherent error, because the yaml you provided loads fine for me... could be export error, encoding...
     
  9. Offline

    fireblast709

    it's adviced to stay consistent, but your YAML will still parse fine regardless as long as siblings share the same indentation.
     
    Hoolean, Rocoty, lol768 and 1 other person like this.
  10. Offline

    Irantwomiles

    If you used notepad++ make sure you didn't use tab for spacing
     
  11. Offline

    mactso

    The order of the lines can matter. I experienced that personally. And to make it worse- sometimes they don't matter and sometimes they do.

    http://wiki.bukkit.org/Plugin_YAML
    Note that "version" is before "main".

    I was having crashes and Romirubi suggested I reorder my config.yml and it fixed the crash issue.

    Try this order...

    Code:
    name: PluginsHider
     
    version: 1.1
     
    description: (optional)
     
    main: me.bukkit.Inkzzz.PluginsHider
     
    commands:
     
      ?:
     
        description: (Optional description)
     
  12. Offline

    teej107

    mactso I don't think order matters. Of the required attributes, I always put version last and I never have problems.
     
  13. Offline

    mactso

    I thought it shouldn't matter either. But my plugin stopped crashing when I reordered them. Weird, eh?
    I figured since it worked for me and it only takes a few seconds to try- why not share.
     
  14. Offline

    Hoolean

    You have a line that - while otherwise and visibly empty - contains a space. Try removing the space from that line or removing the line together and see how everything works out then. :)
     
    Avygeil likes this.
  15. Offline

    TheMeq

    are you sure description is not required? It seems the error is appearing when looking for a description...

    Code:
    [15:52:55] [Server thread/ERROR]: Could not load 'plugins\pluginhider.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]
     
    JordyPwner likes this.
  16. Offline

    JordyPwner

    Some people are looking better :p bwfcwalshy maybe you should READ better :p
     
  17. Offline

    Avygeil

    TheMeq Yes, it is optional. That's just how the method is called, because it's called a description file.
     
  18. Offline

    TheMeq

  19. Offline

    JordyPwner

    just add under version:

    description: some text here
     
  20. Offline

    Avygeil

    JordyPwner We just said it is not required.

    I'd more go with Hoolean 's suggestion, although when I tried it the line was here. Can't debate about it while the OP doesn't respond anyway. :(
     
  21. I always hate situations like this :p I'm betting that the was a problem in your file somewhere, let's go with a tab at some point. You reordering the file wouldn't have done anything like this to fix the issue, however you may have inadvertently removed the tab while reordering the file, thus accidentally solving the problem. Because you don't know that you removed the tab, you naturally assume that the reordering fixed itself, and go on to tell people that the solution is to correct the order of the plugin.yml

    This is what I'd like to dub a "false solution". It is a false solution as it doesn't solve the problem. However, it's not an "incorrect solution" (or a "irrelevant waste of time") as you may end up accidentally fixing the real problem while you're doing it. Posing your false solution will work for those who accidentally solve the problem (i.e. replacing the tab), and not for those who don't.

    FYI, this is also probably why you say it "sometimes the order matters and sometimes it doesn't", even when that isn't actually true. ;)
     
    Avygeil likes this.
  22. Offline

    mactso

    I'm aware of the 2space and 4space no tab issue but I agree it's certainly possible there was a tab in there. The entire plugin.yml is fidgety in eclipse anyway. At least in the default configuration it opens them in wordpad instead of a native edit window in eclipse and then complains plugin.yml isn't in sync for a while after I save the changes.

    Okay.. now i must test it since i have eclipse open. I'm disordering the tags.

    It works perfectly with disordered tags . Checking to see if I copied the original file into my post. I'll look for tabs if so.

    And refreshing before compiling eliminated the in sync issue.

    So I wonder what is wrong with the parent posters code or environment.

    Line 15 (before the permissions line) has one space instead of being an empty line.

    I tested by adding a space before my command line (since I don't use permissions yet) and the plugin still loaded so I guess that's not it.

    The permissions: tag has no spaces before it and it's children have 2 spaces.
    Should that be 2 spaces before permissions and 4 spaces before it's children?

    I'm assuming permissions is at the same level as the command tag but figured why not mention it.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 29, 2016
Thread Status:
Not open for further replies.

Share This Page