I am a mod developer trying to implement a feature similar to the existing /pokecolor command in Pixelmon. I am finding that a pokemon with a display name that contains styling will not be visible with that styling in any GUI. The styling will only be visible in the pokemon's entity's nametag. This means that the styling is not visible in places such as the party overlay, the summary/stats/moves GUI, nor the battle overlay. This is true both for the /pokecolor command and also for using the
method through the Java API and passing in a formatted text component.
I have tried to work around this by using the deprecated API method
that takes in a string instead of a formatted text component. By passing in a string with style tokens (i.e tokens prefixed with the character §), I find that I am able to display the styling everywhere that I expect it to. Unfortunately, this also causes a number of side effects, primarily causing any battle messages that contain the pokemon's stylized display name to vanish or glitch out. I have tried various combinations of using formatted text components and style tokens together, and have also tried adding reset tokens (§r) at the end of the display names, but to no avail. Additionally, pokemon with their nicknames set this way seem to become corrupted in that they begin to cause crashes at the start and end of any battle:
https://pastebin.com/HWdvs0WVI would expect that the original approach of using either /pokecolor or the
method would allow stylized display names to appear in all GUI's.
Screenshots that show stylized display names not appearing in GUI's:
(name appears above entity, but not in party view)
(name appears above entity, but not in summary GUI)
(name does not appear in battle)
Screenshots that show my hack/workaround displaying the stylized name as expected, but causing battle messages to not show properly
(bonus stats are applied here from a custom mod)
(message showing the move Jolteon used is missing)