Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Data component format/dyed color

From SAS Gaming Wiki
Revision as of 11:04, 17 April 2026 by SyncBot (talk | contribs) (Sync: new page from Minecraft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
    • Template:Nbt: The RGB color of the tint applied to a dyed item, typically as a result of combining the item with dyes in a Template:Cd type crafting recipe. More generally, this component is used as the Template:Cd color provider in Minecraft:item model definitions (so only item models that explicitly use this color provider will be tinted). If present on an item, gray text is added to the tooltip showing either an italic "Dyed" when Minecraft:advanced tooltips is off, or a non-italic "Color: #Template:Cd"<ref group="note">The hexadecimal number is always at least 6 digits (with leading zeroes if needed), with additional digits if the alpha channel is included, despite the alpha channel having no effect on the tint color.</ref> instead when Minecraft:advanced tooltips is on. The color is stored as an integer which packs the color's red, green and blue channels using this formula:
      (Template:Color << 16) + (Template:Color << 8) + Template:Color<ref group="note">For positive values larger than 0x00FFFFFF, the most significant byte encodes the alpha channel (opacity), however this is effectively ignored when providing the tint color to the item model, as the tint does not affect opacity.</ref> Template:Calculator
    • Template:Nbt: An alternative format. A list of 3 floats, ranging from 0.0 to 1.0 (inclusive)<ref group="note">Float values outside of this range are accepted, but clamped from 0 to 255 by modulo 256 after being multiplied by 255. For example, -1.0 is equivalent to 0.00392156862 (or 1/255).</ref>, corresponding to the red, green and blue channels of the color. This format is automatically packed into the integer format by multiplying each float by 255, converting them to unsigned bytes (equivalent to taking the floor and then applying modulo 256), then using the formula -16777216 + (Template:Color << 16) + (Template:Color << 8) + Template:Color due to the alpha channel being implicitly set to 255, resulting in a negative integer.<ref group="note">This can result in an item that is not normally obtainable and it affects the hexadecimal code that is shown in the (advanced) tooltip. For example Template:Cd shows "#000000" but Template:Cd shows "#FF000000" despite them both representing the same pure black RGB color.</ref>.

Notes

Template:Notelist

Minecraft:fr:Format de composant de données/dyed color Minecraft:ja:データコンポーネント/dyed color Minecraft:pt:Formato de componente de dado/dyed color Minecraft:uk:Формат компонента даних/dyed color

Contents