The engine allows you to mix and match different material types so long as opaque
isn't involved. However, this system is bugged and may cause portions of a custom block to be invisible.
Demo
Take the following example material instances component used for the chalice custom block in the attached video:
"minecraft:material_instances": {
"*": {
"render_method": "blend",
"texture": "up:antique_chalice.model.liquid.potion_oozing"
},
"chalice": {
"render_method": "alpha_test",
"texture": "up:antique_chalice.model"
},
"adornment": {
"render_method": "alpha_test",
"texture": "up:antique_chalice.model",
"face_dimming": false
}
}
In the geometry, most faces use the 2 named material instances: alpha-tested layers. The potion face uses the default (*
) blended instance.
In the example scene, all nearby blocks are opaque. Note that the chalice, by default, only shows the default blend layer and nothing else. The 3 vanilla blocks in the hotbar represent 3 of the 4 non-opaque material types:
Glow lichen:
alpha_test
Poppy:
alpha_test_single_sided
Magenta stained glass:
blend
(I don't think there's a vanilla block that uses double_sided
, so I skipped that example.)
Finally, observe the tiled grass and coarse dirt ground. These represent chunk boundaries.
When the glow lichen is placed, the chalice bodies are made visible. Observe that this only occurs within the bounds of the same chunk. Also note that this only works for glow lichen. This is because its material is the same type as what is declared for the named instances in the chalice material instance component. If those instances had instead been alpha_test_single_sided
, for example, only the poppy would have aided in rendering the chalice bodies.
Addendum
While it couldn't be conveniently presented, this rendering behavior is per subchunk, not just per chunk. On a final note, changing the default (*
) material instance influences what is rendered when no other blocks of matching material types exist in the same subchunk.
For the chalice, if alpha_test
had been the *
material type and the potion layer had its own named `blend` material instance, the chalice body would've been visible by default instead, and the potion layer wouldn't had been rendered in the demo unless the magenta stained glass had been placed in the same subchunk. If *
is omitted (e.g., if all 6 required instance faces are declared), the chalice would have acted as though using alpha_test
, even if all 6 of those faces would be set to a different material type.
Workarounds
So far as I can tell, there are no workarounds that are sensible. Most easily, the design would have to be compromised (e.g., the potion layer would have to be made opaque). Alternatively, a blended-rendered entity could be placed over the block.
Testing
[media]is a testing world for this bug. There are 5 blocks in the pack bound to the world: 1 for each block rendering type and a composite type containing all of such. In the world, each of the individually rendered blocks is grouped into its own set in their own chunks. What was explained above can be seen here.
Try placing combinations of blocks in different chunks to see the full effect.
Could you please attach an example addon that can be used to reproduce this? 🙂