How do I make it so I can change the colour of my text through the config.yml?

Discussion in 'Plugin Help/Development/Requests' started by InkzzzMC, Dec 5, 2014.

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

    InkzzzMC

    I made a plugin where you can do /website.
    When you do this command it pops up with a message and a link to my website.

    I want to add a option to change the text colours through the config.yml.

    Any help would be appreciated!
     
  2. Offline

    timtower Administrator Administrator Moderator

    InkzzzMC Dynamicaliases is able to do this. Link is in my signature
     
  3. Offline

    InkzzzMC

    When I try and do &a .... ect in my config.yml it changes nothing.

    I have done ChatColor.translateAlternateColorCodes('&' , getConfig().getString("Message") and it still doesn't work.

    It comes up with a mass error in the console / logs.
     
  4. Offline

    mrCookieSlime

    InkzzzMC
    Then please post the Error via Pastebin.
     
  5. Offline

    InkzzzMC

  6. Offline

    timtower Administrator Administrator Moderator

    InkzzzMC Your quotes are messing up the parser
     
  7. Offline

    InkzzzMC

    Meaning? What do I need to do?

    My code:

    if (cmd.getName().equalsIgnoreCase("?") && sender instanceof Player) {
    String Server_Name = getConfig().getString("Server Name");
    String Message = getConfig().getString("Message");
    player.sendMessage(ChatColor.RED + "[" + ChatColor.translateAlternateColorCodes('&' , Server_Name) + ChatColor.RED + "] " + ChatColor.translateAlternateColorCodes('&' , Message));

    }
     
  8. Offline

    timtower Administrator Administrator Moderator

    InkzzzMC I am talking about the quotes in your config.
     
  9. Offline

    mrCookieSlime

    InkzzzMC
    There is nothing wrong with your Code.
    It is the Config which is messed up.
    You used "I'm", however you cannot use ' in a Config like that. I think you have to do \'

    EDIT: timtower You ninja :p
     
  10. Offline

    InkzzzMC

Thread Status:
Not open for further replies.

Share This Page