How to write this plugin.yml?

Discussion in 'Plugin Development' started by mgbeenieboy, Apr 21, 2014.

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

    mgbeenieboy

    I tried to orient on other plugins' plugin.ymls but seems I did it wrong :D

    Code:
    name: PlayerCheck
    main: me.craftwood.plugin.Plugin
    version: 1.0
    author: MGbeenieboy
    dev-url: http://dev.bukkit.org/bukkit-plugins/playercheck/files.rss
    descirption: Gives some basic information about a player
    commands:
      check:
        usage: /check [player]
        description: Gives information about a player
        aliases: [c, check, pcheck, playercheck, pc]
    permissions:
        pcheck.me: true
        pcheck.others: true
        pcheck.private
    I think what I want is clear, HOW is the question :D
     
  2. Offline

    DirtyRedz

    Revise your permissions section of your plugin.yml

    permissions:
    pcheck.*:
    description: Give me a description.
    children:
    pcheck.me: false
    pcheck.others: false
    pcheck.private: false
    pcheck.me:
    description: Give me a description.
    default: false
    pcheck.others:
    description: Give me a description.
    default: false
    pcheck.private:
    description: Give me a description.
    default: false

    P.s a little more elaboration on your question and your problem is always helpful.
     
  3. Offline

    Sagacious_Zed Bukkit Docs

  4. Offline

    mgbeenieboy

    Code:
    name: PlayerCheck
    main: me.craftwood.plugin.Plugin
    version: 1.0
    author: MGbeenieboy
    dev-url: http://dev.bukkit.org/bukkit-plugins/playercheck/files.rss
    descirption: Gives some basic information about a player
    commands:
      check:
        usage: /<command> [player]
        description: Gives information about a player
        aliases: [c, check, pcheck, playercheck, pc]
    permissions:
        pcheck.*
          description: Gives access to all commands and make yourslef uncheckable
          children:
            pcheck.me: true
            pcheck.others: true
            pcheck.private: false
          pcheck.me:
            description: Let you see information about yourself
            default: true
          pcheck.others
            description: Let your see information about other players
            default: true
          pcheck.private
            description: Makes you uncheckable by other players
            default: op 
    It says the problem is line 14, column 18 (description: Gives...) mapping values are not allowed here
     
  5. Offline

    N00BHUN73R

    mgbeenieboy
    Make sure there are no Tabs in your plugin.yml!!!
    That messes it up.
    If there are remove the tabs and do spaces
     
  6. Offline

    mgbeenieboy

    I took care on it, there are no tabs!

    could anyone write a plugin.yml for me? :S

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

    beeselmane

    Code:
    name: PlayerCheck
    main: me.craftwood.plugin.Plugin
    version: 1.0
    author: MGbeenieboy
    dev-url: http://dev.bukkit.org/bukkit-plugins/playercheck/files.rss
    descirption: Gives some basic information about a player
    commands:
      check:
        usage: /<command> [player]
        description: Gives information about a player
        aliases: [c, check, pcheck, playercheck, pc]
    permissions:
        pcheck.*
          children:
            pcheck.me: true
            pcheck.others: true
            pcheck.private: false
          pcheck.me:
            description: Let you see information about yourself
            default: true
          pcheck.others
            description: Let your see information about other players
            default: true
          pcheck.private
            description: Makes you uncheckable by other players
            default: op 
    should work fine..
     
  8. Offline

    mgbeenieboy

    it doesn't
    line 14, column 15, (children:)
     
  9. Offline

    beeselmane

    what's the error?
     
  10. Offline

    mgbeenieboy

    Thank you for your quick support :D

    Code:java
    1. [00:21:37] [Server thread/ERROR]: Could not load 'plugins\PlayerCheck.jar' in folder 'plugins'
    2. org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    3. at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:160) ~[spigot.jar:git-Spigot-1387]
    4. at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [spigot.jar:git-Spigot-1387]
    5. at org.bukkit.craftbukkit.v1_7_R2.CraftServer.loadPlugins(CraftServer.java:355) [spigot.jar:git-Spigot-1387]
    6. at net.minecraft.server.v1_7_R2.DedicatedServer.init(DedicatedServer.java:135) [spigot.jar:git-Spigot-1387]
    7. at net.minecraft.server.v1_7_R2.MinecraftServer.run(MinecraftServer.java:442) [spigot.jar:git-Spigot-1387]
    8. at net.minecraft.server.v1_7_R2.ThreadServerApplication.run(SourceFile:618) [spigot.jar:git-Spigot-1387]
    9. Caused by: org.yaml.snakeyaml.scanner.ScannerException: null; mapping values are not allowed here; in 'reader', line 14, column 15:
    10. children:
    11. ^
    12. at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:871) ~[spigot.jar:git-Spigot-1387]
    13. at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:360) ~[spigot.jar:git-Spigot-1387]
    14. at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:226) ~[spigot.jar:git-Spigot-1387]
    15. at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:558) ~[spigot.jar:git-Spigot-1387]
    16. at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158) ~[spigot.jar:git-Spigot-1387]
    17. at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:143) ~[spigot.jar:git-Spigot-1387]
    18. at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230) ~[spigot.jar:git-Spigot-1387]
    19. at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:159) ~[spigot.jar:git-Spigot-1387]
    20. at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122) ~[spigot.jar:git-Spigot-1387]
    21. at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105) ~[spigot.jar:git-Spigot-1387]
    22. at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:120) ~[spigot.jar:git-Spigot-1387]
    23. at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:481) ~[spigot.jar:git-Spigot-1387]
    24. at org.yaml.snakeyaml.Yaml.load(Yaml.java:412) ~[spigot.jar:git-Spigot-1387]
    25. at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:189) ~[spigot.jar:git-Spigot-1387]
    26. at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:155) ~[spigot.jar:git-Spigot-1387]
    27. ... 5 more
     
  11. Offline

    beeselmane

    There's a ':' missing after pcheck.* lol
    Code:
    name: PlayerCheck
    main: me.craftwood.plugin.Plugin
    version: 1.0
    author: MGbeenieboy
    dev-url: http://dev.bukkit.org/bukkit-plugins/playercheck/files.rss
    descirption: Gives some basic information about a player
    commands:
      check:
        usage: /<command> [player]
        description: Gives information about a player
        aliases: [c, check, pcheck, playercheck, pc]
    permissions:
        pcheck.*: # <-- right there
          description: Gives access to all commands and make yourslef uncheckable
          children:
            pcheck.me: true
            pcheck.others: true
            pcheck.private: false
          pcheck.me:
            description: Let you see information about yourself
            default: true
          pcheck.others
            description: Let your see information about other players
            default: true
          pcheck.private
            description: Makes you uncheckable by other players
            default: op 
    that's better :p
     
  12. Offline

    mgbeenieboy

    Not good enough, could the error be in my java file?

    Code:
    [01:29:17] [Server thread/ERROR]: Could not load 'plugins\PlayerCheck.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:160) ~[spigot.jar:git-Spigot-1387]
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [spigot.jar:git-Spigot-1387]
        at org.bukkit.craftbukkit.v1_7_R2.CraftServer.loadPlugins(CraftServer.java:355) [spigot.jar:git-Spigot-1387]
        at net.minecraft.server.v1_7_R2.DedicatedServer.init(DedicatedServer.java:135) [spigot.jar:git-Spigot-1387]
        at net.minecraft.server.v1_7_R2.MinecraftServer.run(MinecraftServer.java:442) [spigot.jar:git-Spigot-1387]
        at net.minecraft.server.v1_7_R2.ThreadServerApplication.run(SourceFile:618) [spigot.jar:git-Spigot-1387]
    Caused by: org.yaml.snakeyaml.scanner.ScannerException: while scanning a simple key; could not found expected ':';  in 'reader', line 23, column 20:
                description: Let your see information about ...
                          ^
        at org.yaml.snakeyaml.scanner.ScannerImpl.stalePossibleSimpleKeys(ScannerImpl.java:465) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.scanner.ScannerImpl.needMoreTokens(ScannerImpl.java:280) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:225) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:558) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:143) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:230) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:159) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:237) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:159) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:237) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:159) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:237) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:159) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:120) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:481) ~[spigot.jar:git-Spigot-1387]
        at org.yaml.snakeyaml.Yaml.load(Yaml.java:412) ~[spigot.jar:git-Spigot-1387]
        at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:189) ~[spigot.jar:git-Spigot-1387]
        at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:155) ~[spigot.jar:git-Spigot-1387]
        ... 5 more
     
  13. Offline

    beeselmane

    It's not in the java.. but sorry, I don't see any more errors :(
     
  14. Offline

    mgbeenieboy

    I mean in my class ._.
     
  15. Offline

    beeselmane

    Nope, can't be there.. it never even loads your class:
    Code:
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription
    the exception is within the craftbukkit javapluginloader (because of an error in the yml)
    problem is that I can't see the error :p
     
  16. Offline

    mgbeenieboy

    :'( Thanks though.
    Do I really HAVE to write permissions in the plugin.yml?
     
  17. Offline

    beeselmane

    erm… no

    you could push them through the plugin manager.. (I wouldn't really suggest that though…)

    Code:java
    1. this.getServer().getPluginManager().addPermission(new Permission("name.of.permission"));
    2.  
    3. String PREFIX = "pcheck.";
    4. PluginManager manager = this.getServer().getPluginManager();
    5. manager.addPermission(new Permission(PREFIX + "me"));
    6. manager.addPermission(new Permission(PREFIX + "others"));
    7. manager.addPermission(new Permission(PREFIX + "private"));
    8.  
    9. Map<String, Boolean> children = new HashMap<String, Boolean>();
    10. children.add(PREFIX + "me", true);
    11. children.add(PREFIX + "others", true);
    12. children.add(PREFIX + "private", false);
    13. manager.addPermission(new Permission(PREFIX + "*", children));
    14.  
     
  18. Offline

    mgbeenieboy

    :O Look! I forgot a : on the last two permissions.
     
  19. Offline

    MrInspector

    You spelled description wrong, maybe that's the issue. ;)
     
  20. Offline

    beeselmane

    lol.. double fail..
     
  21. Offline

    coasterman10

    I think there should be colons after "pcheck.others" and "pcheck.private":
    Code:
    name: PlayerCheck
    main: me.craftwood.plugin.Plugin
    version: 1.0
    author: MGbeenieboy
    dev-url: http://dev.bukkit.org/bukkit-plugins/playercheck/files.rss
    descirption: Gives some basic information about a player
    commands:
      check:
        usage: /<command> [player]
        description: Gives information about a player
        aliases: [c, check, pcheck, playercheck, pc]
    permissions:
        pcheck.*:
          description: Gives access to all commands and make yourslef uncheckable
          children:
            pcheck.me: true
            pcheck.others: true
            pcheck.private: false
          pcheck.me:
            description: Let you see information about yourself
            default: true
          pcheck.others:
            description: Let your see information about other players
            default: true
          pcheck.private:
            description: Makes you uncheckable by other players
            default: op
     
Thread Status:
Not open for further replies.

Share This Page