This site works best with JavaScript enabled. Please enable JavaScript to get the best experience from this site.
To the best of my knowledge MyCmd does not possess any way to escape formatting codes like essentials does.
Example:
Code: &&c&c = Red
MyCmd Output: & = Red
Expected: &c = Red
Expected source code: <escaped&>c&c = Red
I'm thinking it'd be pretty easy (and useful) to add an '&' as an escape character so anytime there's '&&' it does not trigger a formatting.
Typically i go about doing this in my plugins like so:
public static String colorCode(String str) { if (str != null) { str = str.replaceAll("&&", "<ampersand>"); str = ChatColor.translateAlternateColorCodes('&', str); str = str.replaceAll("<ampersand>", "&"); return str; } else { return null; } }
For now you can use "$NoReplace" at the start of a string to not replace anything. Of course it's not flexible like your suggestion, but i have to see if doing that i'm not going to break something or someone old command.
Bump, this could be extremely useful on my server. If you're worried about breaking something, you could always introduce it as a config option like
experimental_colorescape = false
or something ;P
To post a comment, please login or register a new account.