How do I add multiple colors to sendMessage?

Discussion in 'Plugin Development' started by Multivan, Jan 4, 2013.

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

    Multivan

    Question above, how?

    Code:
    player.sendMessage(ChatColor.AQUA, "Welcome, " + player.getDisplayName() + "!");
    only displays 1 color, but I want to add more colors like

    [RED]Hello, [BLUE]Multivan!

    I hope you understand what I mean

    Thanks for your answers
     
  2. Offline

    Muxon

    Code:JAVA
    1. player.sendMessage(ChatColor.RED + "Hello, " + ChatColor.BLUE + "Multivan!");
     
    Multivan likes this.
  3. Offline

    MrMysterious

  4. Offline

    fireblast709

    Imo bukkit colour codes are more programmer friendly :3. Btw statically importing ChatColor like
    Code:
    import static org.bukkit.ChatColor;
    allows you to do
    Code:java
    1. player.sendMessage(RED + "Hello, " + BLUE + "Multivan!");
     
    lDucks and viruzin like this.
  5. Offline

    ImDeJay

    nice tip, i didnt know that... saves alot of room while coding since you dont have to type "chatcolor.RED"
     
  6. Offline

    Multivan

    Thanks! :D
     
  7. Offline

    lDucks

    You sir, I love you.
     
Thread Status:
Not open for further replies.

Share This Page