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!
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.
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 } }
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
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
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 defaultp 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
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 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.
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 (I changed it to a .txt so I can upload it!) No its not
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.
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.
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)
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
plugin.yml works ever perfectly to me(sometimes i miss a letter that change's everything to dont work )
Hint: Copy you plugin.yml text to YAML parser and look wath's wrong. if nothing wrong test it. not works? pm me.