config List, Colors

Discussion in 'Plugin Development' started by stamline, Sep 20, 2015.

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


    Hi, i want to make so the StringList will be color supported. My code is half working. Everything is fine if i dont use the '&' as the first letter/symbol.

    So this is not working "&5Hello"
    but this is working "H&5ello"

    Do you guys have any ideas to make this work?
    Here is my code
    if(args.length == 0){
                List<String> Message = Main.plugin.getConfig().getStringList("HelpMessages");
                for(String mess : Message){
                    mess = ChatColor.translateAlternateColorCodes('&', mess);
  2. Offline


    Try adding something at the beginning of the message(you could even add Chatcolor.WHITE, that way nothing is changed and no extra text is added.).
  3. Offline


    If you dont care about people using & on the messages, you could simply do .replace("&", "ยง")
  4. Offline





    Even less correct.


    Make sure in the config file that you're escaping the string properly, an attribute that begins with "&" has a different meaning in YAML.
Thread Status:
Not open for further replies.

Share This Page