Stop judging people you don't even know. And yes, I use that chatcolor enum all the time. Like so: Code:java Player p = Bukkit.getServer().getPlayer("Necrodoom"); p.sendMessage(ChatColor.RED + "Hey, " + ChatColor.YELLOW + "Necrodoom," + ChatColor.RED + " Why don't you stop being presumptuous and impetuous");
macboinc Yes, because, you told Pizza371 that it doesnt actually work, when in fact it does, and just because you like it, doesnt mean you need to enforce bad practice on people.
macboinc Yes, because there are objective reasons that ChatColor.<color> is better, namely: 1. It is implementation independant, i.e. if Minecraft were to change the color codes, Bukkit would update, and your code would still work fine, whereas the section character implementation would break. 2. Using the section character decreases code readability, making code harder to maintain, and meaning less obvious, also requiring anyone else looking at the code to look the color code each time they want to use it. So yes, encouraging bad programming practices and telling people things don't work when actually they do is considered bad practice. Ninja'd by Necrodoom
Hm? I though it would be colorless even with the section sign unless you used ChatColor.translateAlternateColorCodes and added it as the character...
Necrodoom I'm not sure I understand what you're getting at... But if you want to color signs ingame, you'll need to listen on SignChangeEvent and set each line to formatted version. Use this I guess: Code:java ChatColor.translateAlternateColorCodes('&', message);
ZanderMan9 What he's saying is that all translateAlternateColorCodes(Character char, String message) does is: message.replace(char, "§");
ZanderMan9 What i meant is, if you want to write a message on a sign, these 3 things would be identical, but the first one would be the best practice one if you make a new message, and the third if you take an existing message: String message; message = ChatColor.RED + "Hello!"; message = "§cHello!"; message = ChatColor.translateAlternateColorCodes('&', "&cHello!");
So wait... All chars would become the string you enter? I've been using it in a completely different way.... Player uses a command, I take and build the args into a string, use translateAlt.... on it and then broadcast it.... And if they say &6Message it comes out as Message. The code is the same as I posted above... Edit: Excuse me, what you said just confused me further... I've been doing it right all along