Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-278626

Dye tints in custom models are invisible in certain contexts

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.4 Release Candidate 3, 1.21.4
    • None
    • Confirmed
    • Items, Resource Packs
    • Normal
    • Platform

      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.

        1. image-2024-12-01-08-32-50-512.png
          1.81 MB
          Vivian Jones

            Unassigned Unassigned
            PrismaticVoid Vivian Jones
            Votes:
            4 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: