Mojira Archive
MC-278626

Dye tints in custom models are invisible in certain contexts

Custom item models that use dye tinting will fail to render their tinted faces in certain conditions. Based on my testing, it happens when:

  • The item has no "dyed_color" component.
  • The item is not a placeable block.
  • The "default" color set in the item definition is a positive number.

The attached resource pack contains a simple item model that displays this. It consists of an upper cube that's tinted and a lower cube that isn't.

How to reproduce:

  1. Install the provided resource pack
  2. Run
    /give @s white_wool[item_model="test:test"]

    This renders correctly.

  3. Run
    /give @s stick[item_model="test:test"]

    This does NOT render correctly (only the bottom cube is visible)

  4. Run
    /give @s stick[item_model="test:test",minecraft:dyed_color=4208181]

    This renders correctly, even though the defined color is exactly the same as the default on the item definition.

Lastly: If you open up the resource pack and go to "assets/test/items/test.json" and change the default color to be any negative number, everything renders as it should with no issues.

Code analysis

The net.minecraft.client.color.item.Firework#calculate and net.minecraft.client.color.item.Dye#calculate use this.defaultColor without wrapping it in ARGB.opqaque.

Unresolved

Vivian Jones

2024-12-01, 02:47 PM

2024-12-13, 09:03 PM

4

1

Confirmed

Normal

Platform

Items, Resource Packs

1.21.4 Release Candidate 3, 1.21.4

-