mojira.dev
MC-307770

Blocks falling back to the missing model show "random" section of the block atlas instead of the missing texture

When a block’s model fails to load for whatever reason and falls back to the “missing model”, placing said block in the world will show a “random” section of the block atlas instead of the missing texture. The attached resource pack triggers this on stone blocks.

This is caused by the way the model baking process resolves Material.Bakeds from the Materials specified in the model JSON. When any model is baked, both atlases are searched for the textures. This search checks the item atlas first and the block atlas second and only if the item atlas query returns null, causing textures existing on both atlases to be resolved to the item atlas. Since minecraft:missingno exists on all atlases, this behavior applies to it. Normally the block model baking has a subsequent check in SimpleModelWrapper.bake() to reject block models using item atlas sprites and fall back to the missing model. However, no such check exists in the special-cased baking of the “global” missing models in ModelBakery.MissingModels.bake() nor does said code attempt to force the use of the missing sprite from the block atlas. Since block models are unconditionally rendered with the block atlas, this causes the placed block to render whatever happens to be on the block atlas in the UV coordinate range occupied by the missing sprite on the item atlas.

The provided reproduction case runs into this issue twice: the non-existent model is replaced with the unbaked “missing model” during dependency resolution, this model is then baked with the incorrect sprite, gets caught by the aforementioned sanity check and then still breaks because the “global” missing models it tries to fall back to is broken.

Environment

Operating System: Windows 10 (amd64) version 10.0
Memory: 32 GB
CPU: 14th Gen Intel(R) Core(TM) i9-14900K
GPU: NVIDIA GeForce RTX 4080

Linked issues

Attachments

Comments 2

Thank you for helping us improve Minecraft! We saved your files:

[media]

The Environment field is supposed to only contain PC details.

Thank you for your report!
We are tracking this issue in MC-307221, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote or provide any additional information to the main ticket, it would be appreciated.

If you haven’t already, please make use of the search feature to see whether an issue has already been reported.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

XFactHD

(Unassigned)

Unconfirmed

(Unassigned)

26.1.2

Retrieved