Tutorials/X-ray glitches

X-ray glitches allow the player to see certain features that are normally hidden behind blocks.

Why bother?
X-ray glitches are useful for locating underground structures such as dungeons and mineshafts. They can also help you find end portal rooms once you are near a stronghold. If you are in the Nether, you can use x-ray glitches to locate fortresses.

General approach
For time efficiency, the game only renders block surfaces if there is a transparent block between the surface and the player. For this purpose, transparent generally means that the player can see through the block, although lava is also transparent for this purpose.

Normally, the camera is inside a transparent block, unless the player is suffocating, in which case the game renders blocks differently. However, it is possible for the camera to be inside a block, but the game does not register that the player is inside. In this case, the player "x-rays" through blocks immediately in front.

Piston and slab method
This method works by pushing a slab into the player's head. Since slabs are partial blocks, the game does not consider the player to be inside a block. This trick has two main variants: One for looking upward and one for looking downward.

To x-ray upward, you need the following: It is recommended to have multiple slabs, so you can see more. Alternatively, you can use stairs. The main setup is as follows, where everything is at head height:
 * 1 lever
 * 2 redstone
 * 1 piston
 * 1 slab

Again, you may wish to surround your head with top slabs wherever possible, to maximize visibility. When you are ready, activate the lever, and the glitch will begin almost immediately.

To x-ray downward, you need the following:
 * 1 lever
 * 2 redstone
 * 2 pistons
 * Several slabs
 * Several full blocks
 * This should include at least 1 sand or other gravity-affected block.

To set this up, start with the same setup as before, but place 2 pistons (1 at head height and one at foot height). The lower piston has a solid block in from, while the upper piston has a bottom slab. Surround yourself with additional blocks, with slabs on top, to maximize visibility. After you pull the lever, the x-ray glitch does not happen yet. Therefore, you can destroy the redstone, including the pistons, and surround yourself further. For the location that was the piston head, placing the full block is tricky, as you cannot look at a suitable surface. Instead, place the sand above where you want it to land, then place the slab as normal. When you are ready to trigger the glitch, enter sneak mode, and your eyes will lie below the top of the slab.

Trivia

 * $$ the Stripe Lands may be considered an x-ray bug, in that they follow the same rules for what blocks are visible. This is why the sides of blocks do not always render.