Code: Code (Text): public String errorPrefix() { String prefix = " §4§l[§c§l!§4§l] "; return prefix; } Result: Note: I have tried replacing all the '§' characters with ChatColor.(COLOR), and keep getting the same result. If anyone has gotten this before, or knows a fix that would be great, because I cannot figure out why this is happening.
Try to use the ChatColor enumeration, Bukkit implemented it so you don't need to do it the way you do it.
Does it work when you directly send a colored message to a player? like Code (Text): player.sendMessage("§6Test");
Use the chatcolor enum, and use it correctly. If you have those characters still, then show how you did it. Encoding isn't an issue with the chatcolor enum, the unicode character is escaped. Additionally, you should not put unicode characters directly in your file, it will make your code much less portable
Don't use unicode, and don't save in UTF-8. Place an empty string inbetween when concatenating chatcolor constants to each other: Code (Text): String example = ChatColor.RED + "" + ChatColor.BLUE; Java has left associativity (reads from left->right), so you need to specify that when you're concatenating the constants, that they are strings.
Try writing Code (Java): ChatColor.RED + ChatColor.BLUE and see the syntax error. Then write Code (Java): ChatColor.RED.toString() + ChatColor.BLUE and see it work, with one less concatenation.
Either or. Compiler will usually resolve it to that anyhow, I'm lazy and like writing just a couple characters.
Honestly I would just use a format method that translates to that from & how i looked at it is unless you are accessing it from another class the method is quite useless, better yet the translateAlternateColorCodes would translate from the config where you can use the config to access from all classes