Simple model-based X-ray exploit
Exploit summary
Using some simple tricks of models, it is possible to effectively X-ray for occluded ore blocks and other desired target blocks. This has likely been the case since the introduction of custom block models in 1.8.
Implementation
The resource pack attached to this issue contains an implementation of this exploit.
It implements the following template models:
- a clone of the standard "cube" model, with cullface disabled on all faces,
- a model that references the above model, as to apply the same texture to every face,
- a model containing no element data that therefore appears invisible.
Diamond ore and deepslate diamond ore are repointed to the cullface-disabled all-faces model, and glowstone is replaced with the empty model. As to render the item form of glowstone visible, the currently functionally unused light texture (MC-239401) has been assigned to it.
Explanation
As glowstone is generally a physically solid, visually opaque block in traditional gameplay with almost all commonly-used resource packs, the game assumes it will always be completely opaque and non-intersectible and culls the faces of blocks behind it as to obviate the rendering of unnecessary triangles. However, this assumption falls apart if glowstone is assigned a nonstandard model which does not fully occlude adjacent faces.
As a result, if glowstone is placed against the surface of an opaque block, the game culls that block's face and prevents it from rendering. The resource pack attached to this issue allows us to see this in action, and, as a result, makes the block faces completely possible to see through.
Conversely, we can forcibly prevent this face-culling behaviour from happening. Face culling is handled by the completely optional "cullface" parameter in model elements, and, if left out, the given face will always be rendered even if completely occluded. (This is currently unintentionally the case for many blocks in the game, all of which can be easily fixed; refer to tickets tagged with the "cullface-missing-from-model" label.) This is the other important part of our exploit; if we can force a given block to always be visible, anyone who could see it will see it.
As a result, if we combine the ability to strip away the rendering of select block faces while forcing the rendering of others, finding diamonds is now far, far easier.
Note that the choices of solid blocks used here are arbitrary; any physically solid and visually opaque full cubes can be used in much the same way. Diamond ores were used as the target block due to their high value alongside their relatively new "reduced air exposure" which makes occluded generation more common, and glowstone was used as the "window" block due to emitting light and making the results easier to see.
How to abuse
To find diamonds, this is rather simple to use:
- Obtain glowstone
- Descend to the diamond layers of the Overworld
- Place glowstone against solid, opaque surfaces
- Repeat until you can see generated diamond ore blocks
How to fix
Many of the quick fixes I can think of for this exploit would either deprive resource pack creators of certain creative liberties, open up possibilities for other exploits, or potentially be detrimental to performance.
Currently, the most effective solution for this exploit I can think of is:
If a block which mobs can suffocate in is surrounded in all six orthogonal directions by other blocks which are full solid opaque cubes, the central block must be culled entirely regardless of its model settings.
In the case of diamond ore, this limits the only blocks which would be visible to ores which have already been exposed on at least one side as a result of terrain generation. As mentioned earlier, this is a very small fraction of such ores, and their exposure makes them far, far more likely to be discovered by legitimate means eventually. In addition, such ores will likely be harder to spot against a cave backdrop unless further resource pack tricks are used such as a brighter texture. Similar arguments could be made regarding ancient debris, another rare block which never (as opposed to less commonly) generates exposed.
The requirement that the central block must be able to be suffocated in is required as to prevent a reoccurrence of the "composter X-ray" exploit, which would be performed effectively identically to its prior form, the only difference being that all six sides of the composter must be against full opaque solid blocks.
I'd be interested in hearing about any other potential fixes to this exploit as to test their effectiveness before their implementation.
2023-01-18, 03:29 PM
2023-02-01, 01:34 PM
1
1
-