Character Translation

Discussion in 'Spigot Plugin Development' started by ProJoosh, May 27, 2015.

  1. So what is it to do to translate Color Codes in a config e.g.

    title = &cHello

    anyway to translate that config &c to ChatColor.RED for p.sendMessage ?
  2. Code (Text):
    String textToFormat = "&cHello";
    textToFormat = ChatColor.translateAlternateColorCodes('&', textToFormat);
    Bukkit.broadcastMessage(textToFormat); //Display the colored text
  3. Thanks :)