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

    xMrPoi

    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

    LucasEmanuel

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

    xMrPoi

    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

    skore87

    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

    wacossusca34

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

    Courier

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

    macguy8

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

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

    xMrPoi

    Thank you! :D
     
  9. Offline

    Timr

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

    wacossusca34

    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

    nate_alex


    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

    PlayinCOD2132

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

Share This Page