Hi Is it true that ChatColor.translateAlternateColorCodes() and ChatColor.stripColors() only translate/strip colors, and not formats (&k &l &m &n &o)? If so, how to translate or strip formats?
I'm just going by the Javadocs but maybe if I could see the code you are using I'd be able to figure it out.
No iea what you said but im just saying String text = "&cHello There, &rnormal &9blue"; String new = ChatColor.translateAlternateColorCodes("&", text);
Wouldn't it be: Code (Text): String new = ChatColor.translateAlternateColorCodes('&', text); with single quotes around &..
Sorry my power went out <,< Could you tell me what happens when you try to set the player's name? Does it only set the color or only the format?
Well I notice your never passing the nickname to the stripUnallowedCodes method here "setNick(args[0],player);" Does this code output as expected? Code (Text): sender.sendMessage(ChatColor.GREEN + player.getName() + "'s nickname has been changed to " + ChatColor.translateAlternateColorCodes('&', stripUnallowedCodes(args[0],player)));
My code is changing the player's nick and also sending the cmd sender a message with the new nick. But it only translates colors but not formats and magic
Right, but I was just saying you're never stripping or translating the code from the nick here "setNick(args[0],player);" so that will never show anything other than the original string. As for the other part I will test.
Are you importing the correct ChatColor? There is a bungee and a bukkit one, you need to import the bukkit one.