How to Make Colored Bold Text?

Discussion in 'Plugin Development' started by xMrPoi, Sep 27, 2012.

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


    I want the plugin to send a message back to the player when a command is sent and the text being aqua and bold. What would I need to add to this?:[​IMG]
  2. Offline


    player.sendMessage(ChatColor.AQUA + ChatColor.BOLD + "Hello dude!");
    If you just browsed the API you couldve found this by yourself.
  3. Offline


    That does not work. It's is underlined in red and says: "The operator + is undefined for the argument type(s) org.bukkit.ChatColor, org.bukkit.ChatColor"
    KaiPol likes this.
  4. Offline


    You probably changed your code because when you concatenate the ChatColor enum with a string, it calls the toString method of the enum, thus making it a string and completely bypassing that error.
    LucasEmanuel likes this.
  5. Offline


    Use the '§' character for this, preceding the color / formatting code.
    Verringer likes this.
  6. Offline


    Just add a "" + in front of the first ChatColor.
  7. Offline


    Even though this is already been said, I'll clarify it more.

    sender.sendMessage(ChatColor.GOLD + "" + ChatColor.BOLD + "This is a gold, bold message");
    mrcat125 likes this.
  8. Offline


    Thank you! :D
  9. Offline


    Due to Bukkit having the ChatColor interface, use of § is discouraged.
  10. Offline


    It works great for me; it's easier and much more convenient to organize. I don't like appending loads of ChatColor objects to my Strings.
  11. Offline


    Well if you are in a server control panel and you want the MOTD to be colored, you must use this character. It doesn't matter what mod/server client it is.
  12. Offline


    Locked. Inactive for 1 1/2 year.
Thread Status:
Not open for further replies.

Share This Page