Config file help.

Discussion in 'Plugin Development' started by MeZTech, Oct 14, 2012.

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

    MeZTech

    I have started making a plugin, and when I made a config option for the command /staff, I got a huge error in console, I tried reading it, but I just don't know whats wrong with it.
    http://pastebin.com/S5i9YH3c
    Thats the stack trace. I also tried making a heal command but it didn't work.
    Here is the code for my main class if you can help me: http://pastebin.com/ncUvbNJn
     
  2. Offline

    CorrieKay

    this isnt a problem with code, the yml file is incorrectly written.

    paste it, and ill tell you where its gone wrong :p

    edit: in regards to your healing code, you dont need to check their permissions. set the permission node for the registered command, give the user the permission, and it will automatically deny them from using the command if they dont have the permission.

    also, make sure youve registered the command.
    edit2: im not 100% sure, but wont setMaximumAir() set the maximum air they have, not the current level?
     
  3. Offline

    RainoBoy97

    I wouldnt make 2 separate onCommands, i would do
    Code:
     public void onCommand(CommandSender sender, Command cmd, String label, String[] args){
        if(cmd.getName().equalsIgnoreCase("staff"){ 
           //code here
        } 
        if(cmd.getName().equalsIgnoreCase("heal"){ 
            //code here
        }
    return true;
    }
     
  4. Offline

    MeZTech

    Ok, here is the yml file:
    http://pastebin.com/FMuCnQh6
     
  5. Offline

    zack6849

    You can't use brackets in YAML. It means something in YAML and therefore throws an error.
     
  6. Offline

    Sagacious_Zed Bukkit Docs

    They can be used as long as they are escaped.
     
Thread Status:
Not open for further replies.

Share This Page