Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-112693

Scoreboard team colors use raw § formatting instead of text components

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Minecraft 18w01a
    • Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13a, Minecraft 17w13b, Minecraft 17w14a, Minecraft 17w15a, Minecraft 17w16a, Minecraft 17w16b, Minecraft 17w17b, Minecraft 17w18a, Minecraft 17w18b, Minecraft 1.12 Pre-Release 1, Minecraft 1.12 Pre-Release 2, Minecraft 1.12 Pre-Release 3, Minecraft 1.12 Pre-Release 4, Minecraft 1.12 Pre-Release 5, Minecraft 1.12 Pre-Release 6, Minecraft 1.12 Pre-Release 7, Minecraft 1.12, Minecraft 17w31a, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, Minecraft 1.12.2 Pre-Release 2, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 17w45a, Minecraft 17w46a, Minecraft 17w48a, Minecraft 17w50a
    • Confirmed

      The bug

      Scoreboard team name coloration uses legacy §-based formatting.

      To reproduce

      By running the following commands:

      /scoreboard teams add test
      /scoreboard teams option test color red
      /scoreboard teams join test
      text
      

      The following will be placed in the log file:

      [Server thread/INFO]: <§cpokechu22§r> text
      [Client thread/INFO]: [CHAT] <§cpokechu22§r> text
      

      This only happens for situations where § is used directly; in other cases of formatting (such as using /tellraw) this does not happen.

      This can also be seen by inspecting data/scoreboard.dat, where it can be seen that Prefix and Suffix contain §-based format codes.

      Proposed fix

      The ideal fix would be to get rid of Prefix and Suffix entirely and instead serialize a text component style within the team. To port to this system, the existing TeamColor tag could be used.

      However, there may be custom maps that use modified Prefix and Suffix values. This could be dealt with by testing the §-code that the color would produce against Prefix and §r against Suffix - if they do not match, then don't migrate (or migrate in a more complex way).

      See also Solution discussion for upgrading legacy formatted scoreboard prefix and suffix to text components.

            dinnerbone [Mojang] Nathan Adams
            pokechu22 [Mod] Pokechu22
            Votes:
            8 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: