Help with plugin.yml!!!

Discussion in 'Plugin Development' started by AidoP, Oct 13, 2012.

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

    AidoP

    well Iv made a half made plugin and I need to add the commands to plugin.yml!Iv done it to one of my plugins but with multi arg plugins its not as easy.Also Im having troubles with permissions. How do I set it to only admin?

    Thanks for help!
     
  2. Offline

    RainoBoy97

    Code:
    if(player.hasPermission("permission.node){
        //then stuffs here 
    }else{
        //you dont have permission stuff
    }
    
    You dont need to add all the args for the command in the plugin.yml, if you have /command first, you only need to add the /command and not the first.
     
  3. Offline

    xXSniperzzXx_SD

    This is a piece of my code
    Code:
    if(args[0].equalsIgnoreCase("End")) {
                            if(!player.hasPermission("Infected.Force")) {
                                player.sendMessage(plugin.I + "Invalid Permissions.");
                                return true;
                            }else{
                            //Code in here
                            }
                        }
     
  4. Offline

    WinX-9

    I don't think you can have Java code in the plugin.yml.
     
  5. Offline

    gcflames5

    That's not the plugin.yml, they are helping with the permission

    The problem you may be having with the plugin.yml is that:
    • It is not in the correct directory
    • Or, you pressed [TAB] while editing it
     
  6. Offline

    AidoP

    This is the error im getting:
    Code:
     06:18:20 [SEVERE] Could not load 'plugins/Paintball.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:208)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:132)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:222)
    at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:198)
    at net.minecraft.server.ServerConfigurationManagerAbstract.<init>(ServerConfigurationManagerAbstract.java:50)
    at net.minecraft.server.ServerConfigurationManager.<init>(SourceFile:11)
    at net.minecraft.server.DedicatedServer.init(DedicatedServer.java:105)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:380)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
    Caused by: while scanning for the next token
    found character'\t' that cannot start any token
     in "<reader>", line 8, column 5:
           description: Join the Paintball ... 
            ^
     
    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:358)
    at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:179)
    at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingValue.produce(ParserImpl.java:591)
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:161)
    at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:146)
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:133)
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:237)
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
    at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:237)
    at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
    at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:123)
    at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:106)
    at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:121)
    at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:480)
    at org.yaml.snakeyaml.Yaml.load(Yaml.java:411)
    at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:42)
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:203)
    ... 8 more
     
    and this is the plugin.yml:
    Code:
     name: Paintball
    main: au.com.ganhaar.Paintball.Paintball
    version: 0.0.1
    commands:
        pb:
            description: Base command for Paintball!
        pb.j:
        description: Join the Paintball arena!
        pb.set.spawn:
        description: Sets Paintball arenas spawn!
    permissions:
        paintball.pb:
            permission-message: You dont have Permission to do this command!
        paintball.pb.j:
        permission-message: You dont have permission to do this command!
        paintball.pb.set.spawn:
        permission-message: You dont have permission to do this command!
        default:op 
    PLEASE HELP!
    Thanks :D
     
  7. name: Paintballwrong indent
    main: au.com.ganhaar.Paintball.Paintball
    version: 0.0.1
    commands:
    pb:
    description: Base command for Paintball!
    pb.j:
    description: Join the Paintball arena!wrong indent
    pb.set.spawn:
    description: Sets Paintball arenas spawn!wrong indent
    permissions:
    paintball.pb:
    permission-message: You dont have Permission to do this command!
    paintball.pb.j:
    permission-message: You dont have permission to do this command!wrong indent
    paintball.pb.set.spawn:
    permission-message: You dont have permission to do this command!wrong indent
    default:eek:p


    Caused by: while scanning for the next token
    found character'\t' that cannot start any token
    in "<reader>", line 8, column 5:
    description: Join the Paintball ...
    ^
    you used a TAB somewhere
     
  8. Offline

    AidoP

    thought it was the tab XD but then it also gives you errors for to many/little spaces :(
    but thanks! I posted a reply to my post that says the error I get when I run it and my plugin.yml!
    THANKS!
    you awesome community!

    Used a couple of tabs..... ill fix ir up and I HOPE I get the right indentation. is that all thats wrong? or do I need to change the multi arg commands there?

    Thanks for your help!

    you were fast :D

    did it! It worked! but..... iv got a new error XD
    Code:
     06:41:49 [SEVERE] Could not load 'plugins/Paintball.jar' in folder 'plugins'
    org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:208)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:132)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:222)
    at org.bukkit.craftbukkit.CraftServer.<init>(CraftServer.java:198)
    at net.minecraft.server.ServerConfigurationManagerAbstract.<init>(ServerConfigurationManagerAbstract.java:50)
    at net.minecraft.server.ServerConfigurationManager.<init>(SourceFile:11)
    at net.minecraft.server.DedicatedServer.init(DedicatedServer.java:105)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:380)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
    Caused by: mapping values are not allowed here
     in "<reader>", line 4, column 9:
        commands:
                ^
     
    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:733)
    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:305)
    at org.yaml.snakeyaml.scanner.ScannerImpl.peekToken(ScannerImpl.java:202)
    at org.yaml.snakeyaml.parser.ParserImpl$ParseDocumentEnd.produce(ParserImpl.java:265)
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:161)
    at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:171)
    at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:125)
    at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:106)
    at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:121)
    at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:480)
    at org.yaml.snakeyaml.Yaml.load(Yaml.java:411)
    at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:42)
    at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:203)
    ... 8 more
     
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
  9. may I see your config.yml after you corrected the other errors?
     
  10. Offline

    AidoP

    Yep sure!
    Code:
     name:Paintball
    main:au.com.ganhaar.Paintball.Paintball
    version:0.0.1
    author:AidoP
    commands:
        pb:
            description: Base command for Paintball!
        pb.j:
        description: Join the Paintball arena!
        pb.set.spawn:
            description: Sets Paintball arenas spawn!
    permissions:
        paintball.pb:
            permission-message: You dont have Permission to do this command!
        paintball.pb.j:
            permission-message: You dont have permission to do this command!
        paintball.pb.set.spawn:
            permission-message: You dont have permission to do this command!
        default:op 
    Thanks for the help you've given me!

    hm.. I think the thing might be stuffing up so heres the file aswell :D
    (I changed it to a .txt so I can upload it!) No its not
     

    Attached Files:

  11. there is still an extra space at the beginning of the name tag
     
  12. Offline

    AidoP

    Since then iv updated it and found the problem! Its not liking a ":" at the end of the line. Not sure why its doing this since essentials plugin.yml is the EXACT same only different commands. Heres the updated plugin.yml:
    Code:
    name:Paintball
    main:au.com.ganhaar.Paintball.Paintball
    version:0.0.1
    website:http://www.ganhaar.com.au/Aidan/AidoP/
    description:Paintball For Bukkit!
    author:AidoP
    command:
      pb:
        description:Base command for Paintball!
      pb.j:
        description:Join Paintball!
      pb.set.spawn:
        description:For Admins! Set Arenas Spawn.
    permissions:
      paintball.pb.set.spawn:
        permission-message:You dont have permission to do this command!
        default:op
    I fixed it bye putting it all on one line or similar It worked but crashed my server instead.
     
  13. you kno w there need a space after : ?
     
  14. Offline

    AidoP

    Oh :|

    Also thanks for your help!

    \
    doesn't work!
    same error!
    ill make a git repository for this!

    here: https://github.com/AidoP/PaintballPlugin

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 29, 2016
  15. you forgot the files inside, so we cannot see if they are correct
     
  16. Offline

    AidoP

    Oh yeh sorry about that. Do I need the app to add files because I saw nothing that would let me! (I can't get the app I have OSX 6!)

    How do I add files? They said stuff about terminal but I think they were talking about the git app.
    Also I have a Mac (if you didn't notice)
     
  17. Offline

    mathiasrocker

    Here is the finally plugin.yml:
    Code:
    name: Paintball
    main: au.com.ganhaar.Paintball.Paintball
    version: 0.0.1
    commands:
        pb:
            description: Base command for Paintball!
        pb.j:
            description: Join the Paintball arena!
        pb.set.spawn:
            description: Sets Paintball arenas spawn!
    permissions:
        paintball.pb:
            permission-message: You dont have Permission to do this command!
        paintball.pb.j:
            permission-message: You dont have permission to do this command!
        paintball.pb.set.spawn:
            permission-message: You dont have permission to do this command!
            default: op 
    Hope it's helped :)
     
  18. Offline

    AidoP

    Thanks it worked!
    But...
    Now I get initial server error when I try to use a command!
     
  19. Offline

    mathiasrocker

    :) plugin.yml works ever perfectly to me(sometimes i miss a letter that change's everything to dont work :p)
     
  20. Offline

    AidoP

    Yeh THANKS!
    Just hate it how if you fix one problem you get another.
     
  21. Offline

    mathiasrocker

    Hint: Copy you plugin.yml text to YAML parser and look wath's wrong. if nothing wrong test it.
    not works? pm me.
     
Thread Status:
Not open for further replies.

Share This Page