mojira.dev
MC-183460

Using the "reset" color in JSON text does not reset the color to default for enchanted item names and other cases

The bug

When attempting to use reset in JSON text as a color for enchanted item names and other cases, it does not reset the color to default. This does not happen in 1.15.2.

How to reproduce

Use the following command to give yourself an enchanted Stick with a customized name:

/give @s stick{display:{Name:'{"text":"Wooden Stake","color":"reset","italic":false}'},Enchantments:[{}]}

→ ❌ The name of the enchanted item is still aqua instead of the default color.

Other information

The bug also affects the following cases:

  • commands for Signs which should have black text at the end

    /give @s oak_sign{BlockEntityTag:{Text2:'[{"text":"blue ","color":"blue"},{"text":"black","color":"reset"}]'}}
  • commands for Chests or Trapped Chests which should have gray text at the end

    /give @s chest{BlockEntityTag:{CustomName:'[{"text":"blue ","color":"blue"},{"text":"gray","color":"reset"}]'}}
  • most JSON text in general

    [{"text":"Golden ","color":"gold"},{"text":"Pickaxe","color":"reset"}]

Workaround

Instead of using the reset color for the last text, an empty string can be added at the beginning of a text list:

["",{"text":"Blue","color":"blue"}," and Default"]

However, it only works for other JSON text and not for item names.

Linked issues

Attachments

Comments 2

The workaround I am using is to put an empty text component at the beginning:

[{"text":""},{"text":"actual text","color":"blue"},{"text":"More text"}]

@unknown, I am already aware of that workaround, but it does not work for item names. However, I have added that in the description for other JSON text.

user-a4a49

boq

Confirmed

Normal

Commands

color, json, json-text, reset

20w19a, 20w20a, 20w20b, 20w21a, 20w22a, ..., 21w15a, 21w16a, 21w17a, 21w18a, 21w19a

Retrieved