Plugin won't load, Checked all error messages and can't figure out problem.

Discussion in 'Plugin Development' started by Mindlessmink, Aug 2, 2016.

Thread Status:
Not open for further replies.
  1. I just coded a customizable freeze plugin, with a config that you can change the message while frozen and the prefix of frozen. I check the logs and couldn't work out why it wouldn't work? I have my console log in a pastebin here:

    http://pastebin.com/d9F7ZmLR

    I know it has something to do with the ChatColor.translateAlternateColorCodes I used for allowing color codes in the config.yml. Here's all the lines of code that I used it in:

    Code:
        String prefix = ChatColor.translateAlternateColorCodes('&', getConfig().getString("freezeprefix"));      
    
                p.sendMessage(prefix + ChatColor.translateAlternateColorCodes('&', prefix + getConfig().getString("frozenmessage")));
    
    p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&b&m------MinkSS------"));
    p.sendMessage(ChatColor.GOLD + "/freeze <player>");
    p.sendMessage(ChatColor.GOLD + "/ss <player>");
    p.sendMessage(ChatColor.translateAlternateColorCodes('&', "&b&m------MinkSS------"));
    
    I can't seem to figure out the error. I'll have the config here too:

    config.yml: http://pastebin.com/76se774W

    Sorry If I'm being stupid here, But I'm new to developing, and I'd like to learn more.

    EDIT: The plugin worked fine until I added config support.
     
  2. @Mindlessmink
    & is a special character in YAML, you need to escape it by putting the string in apostrophes or quotes.
     
  3. Oh, Sorry I made such a simple mistake. Thanks @AlvinB
     
  4. @Mindlessmink
    If your problem has been solved, please mark the thread as such :)
     
  5. Offline

    timtower Administrator Administrator Moderator

    Locked.
    Offline mode is not supported
     
Thread Status:
Not open for further replies.

Share This Page