Rumen Kozuharov

Minecraft Java Edition Mod/Hack Developer using Fabric 26.2. Break down your problem into clear, sequential steps. Be sure to check your answer for logical or factual errors before finalizing. If any part is uncertain, explicitly state the uncertainty. Ensure that your techniques and code are compatible with Minecraft Java Edition and Fabric 26.2, not Bedrock Edition. Solve this as if it will be reviewed by a Minecraft Developer expert. Feel free to use any resources or encourage me to ask for other resources you can provide.

Now...

Build me an Xray Hack that I can use to find ores and diamonds and netherite really fast on my world.

Kodari AI
KodariNov 7 at 8:14 pm 2
OreVisionXray
OreVisionXray is a Fabric 26.2 client-side mod that highlights valuable ores through walls. It renders glowing wireframe overlays around diamond, netherite, iron, gold, emerald, and ancient debris blocks within a configurable radius. Features include a toggle keybind, adjustable render distance, block color customization, and a smooth fade animation. The mod uses Mixin injection into the world renderer to draw outlines without affecting gameplay or server-side behavior, making it safe for single-player worlds.
  1. Set up a client-only Fabric 26.2 mod with a toggle key.

  2. Verify the 26.2 render hooks and ore identifiers from the mounted source.

  3. Add the mixins, metadata, and keybind translations so X-ray reveals ore blocks through terrain.

Added a client-only Fabric 26.2 OreVision mod. Press X to toggle X-ray; it hides terrain while showing vanilla ores and Ancient Debris, and refreshes loaded chunks when toggled. Use it in your own worlds or only on servers where X-ray is allowed.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
9 216
src/client/java/com/kodari/orevision/OreVisionClient.java
package com.kodari.orevision;

import com.mojang.blaze3d.platform.InputConstants;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keymapping.v1.KeyMappingHelper;
import net.minecraft.client.KeyMapping;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.Identifier;
import net.minecraft.world.level.block.state.BlockState;

import java.util.Set;

public final class OreVisionClient implements ClientModInitializer {
	private static final Set<String> ORE_BLOCK_PATHS = Set.of(
		"coal_ore", "deepslate_coal_ore",
		"copper_ore", "deepslate_copper_ore",
		"diamond_ore", "deepslate_diamond_ore",
		"emerald_ore", "deepslate_emerald_ore",
		"gold_ore", "deepslate_gold_ore", "nether_gold_ore",
		"iron_ore", "deepslate_iron_ore",
		"lapis_ore", "deepslate_lapis_ore",
		"redstone_ore", "deepslate_redstone_ore",
		"nether_quartz_ore", "ancient_debris"
	);

	private static boolean enabled;

	public static boolean isEnabled() {
		return enabled;
	}

	public static boolean isOre(BlockState state) {
		Identifier id = BuiltInRegistries.BLOCK.getKey(state.getBlock());
		return id != null && ORE_BLOCK_PATHS.contains(id.getPath());
	}

	@Override
	public void onInitializeClient() {
		KeyMapping toggleKey = KeyMappingHelper.registerKeyMapping(new KeyMapping(
			"key.orevision.toggle",
			InputConstants.Type.KEYSYM,
			88,
			KeyMapping.Category.register(Identifier.fromNamespaceAndPath("orevision", "main"))
		));

		ClientTickEvents.END_CLIENT_TICK.register(client -> {
			while (toggleKey.consumeClick()) {
				enabled = !enabled;
				client.levelExtractor.allChanged();
			}
		});
	}
}