Public Static not functioning correctly.

Discussion in 'BungeeCord Plugin Development' started by Compilable, May 23, 2015.

  1. PHP:

    public static String prefix = "§a§lParties §8§l|  ";
    It works, but in-game, it only shows like the color white.
    Can anyone help?
  2. What happens when you type the exact same string into your client?
  3. It shows, but it's only white.
  4. Have you tried using ChatColors?
  5. I can change to ChatColors, but it'll take a lot of time because there are alot of commands..
  6. Try to change your encoding to UTF-8, does this help you?
  7. Nope.
    Is it a bug?
    Should i contact md_5?
  8. Try:
    Code (Java):
    public static String prefix = ChatColor.translateAlternateColorCodes('&', "&a&lParties &8&l|  ");
    • Agree Agree x 1
  9. It still shows up as a white message, not colored.
  10. That's odd, it works fine for me. Would you mind showing a line of code where you are trying to use the prefix?
  11. Here:
    Code (Java):

      p.sendMessage(new ComponentBuilder(prefix).append("Not enough arguments.").color(ChatColor.DARK_RED).create());
      p.sendMessage(new ComponentBuilder(prefix).color(ChatColor.DARK_GRAY).append("/p invite <player>").color(ChatColor.GREEN).create());
  12. Why aren't you just you just sending them a regular message? Why are you using TextComponents? Doesn't look like you need to be.
  13. So, briefly, what do i do?
    Change the ComponentBuilder to TextComponent?
  14. No, just send a regular message:
    Code (Java):
    p.sendMessage(prefix + "Your message here");
    • Agree Agree x 2
  15. Oh stupid me.