Colored console messages

Discussion in 'Plugin Development' started by mastermustard, Feb 27, 2013.

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

    mastermustard

    How would I change the color of messages that show up in console?
     
  2. Offline

    RealDope

    Pretty sure if you just concat with a ChatColor enum it works?
     
  3. Offline

    mastermustard

    oh alright i was under the impression it was much more complicated from remembering past threads

    hmm i did this wrong on startup it give no errors but instead of a colored message it puts a "degree" symbol and the letter "b" in front of it

    Code:
    @Override
        public void onEnable() {
            PluginDescriptionFile pdfFile = this.getDescription();   
            this.logger.info(ChatColor.AQUA + pdfFile.getName() + " Version " + pdfFile.getVersion() + " Has been enabled");
            PluginManager pm = getServer().getPluginManager();
            pm.registerEvents(this, this);
       
            getConfig().options().copyDefaults(true);
            saveConfig();
     
        }
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  4. Offline

    RealDope

    Try just with & and a code in front of it. I don't think it's that complicated.
     
  5. Offline

    Technius

    The color code is actually the section symbol '§'. People just use '&' because it is similar.

    Perhaps you have "-nojline" enabled on your server? It's not related to your code, but to your OS and server setup.
     
  6. Offline

    mastermustard

    how would i check that? obviousely through cmd prompt but
     
  7. Offline

    Technius

    If you're running it through start.bat, look for -nojline.

    Oh, and can we get a screenshot?
     
  8. Offline

    Carnivore

    Send a message to the console message sender instead of the server logger. It'll support the colors.

    Code:
    Bukkit.getServer().getConsoleSender().sendMessage(ChatColor.GOLD + "Golden message!" + ChatColor.RESET);
     
Thread Status:
Not open for further replies.

Share This Page