Add Color To Broadcasts?

Discussion in 'Plugin Development' started by N0z, Aug 5, 2011.

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

    N0z

    My code
    Code:
    getServer.broadcastMessage(player+"&4 lost faith in all humanity. *Facepalms*");
    In-Game it shows up as
    Code:
    (Player) &4lost faith in all humanity. *FacePalms*
    With no color code!

    And my player variable
    Code:
    Player player = (Player) sender;
    and in game
    Code:
    CraftPlayer{name=N0z}
    HELP ME FIX PLEASE ! D:
     
  2. Offline

    Shamebot

    Code:
    getServer().broadcastMessage(player.getName() + ChatColor.DARK_RED + "blah bla blub");
     
  3. Offline

    N0z

    THANKS!

    But how do you add player color?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  4. Offline

    Shamebot

    ?
     
  5. Offline

    N0z

    Color to the player name like
    Shamebot bla bla bla
     
  6. Offline

    Shamebot

    I think
    Code:
    player.setDisplayName(ChatColor.Green+player.getName());
    but it's the name in chat, not above the head.
     
  7. Offline

    N0z

    Thanx
     
Thread Status:
Not open for further replies.

Share This Page