mojira.dev
MC-295687

The list form of the dyed_color component sets an alpha value of 255

Summary:

When specifying the “dyed_color” component as a list of 3 numbers, the resulting component stores the decimal result with an alpha value of 255. This causes the tooltip to show an extra “FF” at the start of the hex color (when advanced tooltips are enabled). Since dyeing an item in vanilla does not use this alpha channel, it does not make sense for it to be used here in the list form, and since the list cannot specify a 4th number, there is no way to modify this without using the integer form of the component.

As the component is meant to hold an RGB number, it does not make sense for it to support storing an ARGB number, let alone defaulting to an ARGB number when specifying the component in the list form of only 3 numbers.

Steps to reproduce:

Run the following two commands, which in theory should give identical items:

/give @s leather_chestplate[dyed_color=0]
/give @s leather_chestplate[dyed_color=[0,0,0]]

While both items look identical, running the following command shows that they are stored as 0 and -16777216, respectively:

/data get entity @s SelectedItem.components.minecraft:dyed_color

Note that this alpha channel can be set with the integer form as follows (the hex syntax is used to show the issue easier):

/give @s leather_chestplate[dyed_color=0xFF000000]

Expected results:

As the alpha channel has no effect on how the dyed item appears ingame (other than its tooltip), the “dyed_color” component should not support values outside of the typical range of 0x000000 to 0xFFFFFF.

Additional information:

This also affects the entries within the “colors” field of “custom_model_data”, as each color can be defined as an integer or list of 3 numbers, representing an RGB number.

Comments 0

No comments.

42Richtofen42

gegy

Confirmed

Platform

Normal

Commands, Items

1.21.5 Release Candidate 1

Retrieved