Jump to content

[1.11.2] Illegal characters in chat quick question


ctbe

Recommended Posts

I was so tired that I accidentally used sendChatMessage(String) instead of sendMessage(ITextComponent) which is what I really needed. (I know, programming while tired is not a good move) However, it surprised me that one cannot use color codes for sendChatMessage as they get filtered and the § character is treated as disallowed. The offender will get disconnected with the message: "Illegal characters in chat" on the screen.

 

Would anyone happen to know of reasons for why sending chat messages with color is disallowed? I don't need to broadcast chat messages with color. I just need to display a colored message to the player performing an action and because said messages can display many times per player it would flood the chat if it is broadcasted. So I'm okay with sendMessage. I mean, imagine if I have 100 players online and at least 50 decide to perform a message displaying action at the same time or with 1-3 seconds of difference. It would be awful for all players to see 50 messages in such a short amount of time flooding their chat.

 

Still, it made me curious as to why it is not allowed to use sendChatMessage with color. (Nothing occurs to me, I hope I am not touching a sensitive subject here, it's just curiosity)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.