Adding Color (&)

Discussion in 'Plugin Development' started by Skylord_Torni, Aug 12, 2015.

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

    Skylord_Torni

    So i've been doing java for a while now but I never got into using color in game. I am trying to figure out how to make it so I can use &a, &1 etc in game, and within my plugins config. I can figure out the code to be exact. I am trying to make it so they can use coloured chat in game, like &1 <their message> in game, and like &aWelcome to the server in the config, but I don't know the code. This is the only place I can think about asking evacuee I'm very confused. Thanks.
     
  2. Offline

    Cycryl

    @Skylord_Torni
    in minecraft the caracter that defines color is §
    if you are saving something to the config that character might not load so set it with & in the config and then do getConfig().getString("message").replace("&","§");
     
  3. Offline

    MOMOTHEREAL

    By default, Minecraft understands the section sign to represent colors. However, if you do not want to copy paste it everywhere, you can use Bukkit's built-in method:

    Code:
    String color = ChatColor.translateAlternateColorCodes('&', "&aThis is green, &cand this is red")'
     
Thread Status:
Not open for further replies.

Share This Page