mojira.dev
MC-131352

Item rarity color / colour overrides first text component's colour in the held tooltip (item switching)

This seems to be related to MC-5206 although italics seem to work.

This appears to be happening because the item rarity colour replaces the colour of the first text component.

Reproduce:

Run the command:

/give @s dirt{display:{Name:"{\"text\":\"Test\",\"color\":\"red\"}"}}

And look at the tooltip in the inventory, then look at the item when you switch to the slot in the hotbar.

[media]

Comparing this to spawning in a dragon egg with the same command:

/give @s dragon_egg{display:{Name:"{\"text\":\"Test\",\"color\":\"red\"}"}}

You can see that the colour has been overridden by the rarity colour.

[media]

Linked issues

Attachments

Comments 5

Tedstar (Curtis Anderson)

I think this issue is a result of the fix of MC-130145.

This appears to be happening because the item rarity color replaces the color of the first text component. Because having color in other places overrides the rarity color.

1. The items in a text component array after the first still show color.
2. Components in the "extra" array show their correct color.

Technically that means this effect can be overcome, but I think it is a bug. When the item rarity color is being added to the text component over the hotbar, it should check that it is not overriding another color already.

Example commands:
Work-around #1:

/give @s stick{display:{Name:"[{\"text\":\"This should be red.\",\"color\":\"red\"},{\"text\":\"This is blue.\",\"color\":\"blue\"}]"}}
[media]

Work-around #2:

/give @s stick{display:{Name:"{\"text\":\"\",\"extra\":[{\"text\":\"Extra is red.\",\"color\":\"red\"},{\"text\":\"Extra is blue.\",\"color\":\"blue\"}]}"}}
[media]

user-a4a49

Affects 1.13-pre3!

CreeperMagnet_

Another small issue with this, is if you override the item rarity colors to white with lang files, and then give yourself the item enchanted, then the enchantment blue won't appear, while it does appear on other items with the white color.

EDIT: Basically, the fix for this should be that it should be overridden when you're attempting to set the color to anything but white, and if it's not enchanted. That might lead to some annoying issues, however.

CreeperMagnet_

Can confirm for 1.13-pre4.

user-a4a49

Affects 1.13-pre6!

Jayceebee

coschevi

Confirmed

Minecraft 1.13-pre2, Minecraft 1.13-pre3, Minecraft 1.13-pre4, Minecraft 1.13-pre5

Minecraft 1.13-pre7

Retrieved