PrismarineJS / prismarine-chat

A parser for a minecraft chat message
MIT License
34 stars 22 forks source link

`toMotd` uses non-standard (well, not supported by the notchian client) hex notation #84

Open ChipmunkMC opened 1 year ago

ChipmunkMC commented 1 year ago

The toMotd method of ChatMessage uses §#rrggbb notation for hex colors, which is non-standard. When §#123456a is rendered by the notchian client, it appears as 123456a (because the character after a section sign always gets hidden, regardless of whether it is a valid color code). Please consider using the color code of the nearest color instead. Also, for toAnsi you should consider not wrapping toMotd if you want it to support hex colors. A problem caused by toAnsi wrapping toMotd and handling §#rrggbb hex colors is that it causes messages such as {"text":"§#123456a"} to get colored (such messages are uncommon, but they can exist).

Parker2991 commented 4 months ago

so does ansi and html i think