Items may use the minecraft:dyeable component to allow an item to be dyed in cauldrons. Dyeable items may make use of either the default and dyed texture references in the minecraft:icon component. By default, the item will use the default texture. When an item is dyed, it will instead use the dyed texture.
The minecraft:dyeable component supports setting a default dye color via the default_color property. When this is set, items begin dyed as that color. Unfortunately, when default_color is configured, the engine incorrectly uses the default texture instead of the dyed texture in the following locations:
Held item
Item entity
Item frame display
Shelf display
In this situation, the dyed texture is only correctly used for the UI icon. Note that the dyed texture will be correctly applied everywhere after re-dyeing via a cauldron.
Demonstration
The attached screenshots use the same item. The item has the default texture set to an apple, and the dyed texture set to leather horse armor. The item is dyed blue by default.
The screenshot where the held item appears as a dyed apple shows the bug. Both the icon and held item should be using the leather horse armor texture, as the item is already dyed using its default behavior.
Shown in the other screenshot is that re-dyeing the item in a cauldron will update the texture references to use the right texture: leather horse armor.
Reproduction
The demonstrated item used the following definition:
{
"format_version": "1.26.20",
"minecraft:item": {
"description": {"identifier": "bug_dyeable:custom_item"},
"components": {
"minecraft:icon": {
"textures": {
"default": "apple",
"dyed": "leather_horse_armor"
}
},
"minecraft:dyeable": {"default_color": "#40A0FF"}
}
}
}The demo screenshots and code are taken from the behavior pack in the attached world for convenience. This world can be opened (in Minecraft Preview) for inspection or unzipped to access the code associated with such. It’s recommended to try dyeing the item in a cauldron to see its texture update to be correct in all cases.
Thank you for helping us improve Minecraft! We saved your files: