Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending message through CommandSender.sendMessage(String) doesn't parse colours. #361

Closed
MisterCavespider opened this issue Aug 30, 2016 · 4 comments

Comments

@MisterCavespider
Copy link

Exactly as the title states.

sender.sendMessage("&6TEXT"); wont parse the colour.

@picknchew
Copy link
Member

The ampersand, & is not the color character for Minecraft. It is actually the section sign, §.

@mastercoms
Copy link
Member

You have to do sender.sendMessage(ChatColor.GOLD + "TEXT"). & and section signs will not work as they are not parsed by Bukkit by default. EssentialsChat will add this functionality.

@aramperes
Copy link
Member

Alternatively to what @mastercoms said, you can use ChatColor.translateAlternateColorCodes('&', "&6TEXT"); (javadoc)

@gdude2002
Copy link
Contributor

Yup, out of experience with Bukkit, I can agree with everyone else here. sendMessage does not parse the colour, and that is expected behavior. There are plugins which change that, but you shouldn't rely on their presence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants