Noah Lee

make a mod for 26.2 where you can see any block you want my just turning it on or off and you can see that block through walls and any block or ground or water.

Kodari AI
KodariOct 1 at 1:43 am 3
BlockVisionToggle
BlockVisionToggle is a Minecraft Fabric mod for version 26.2 that allows players to toggle X-ray vision for any block type. Players can enable or disable visibility of specific blocks through a simple command or keybind, making selected blocks visible through walls, ground, and water. The mod provides a configurable block list, letting users add or remove blocks from their vision overlay. When active, targeted blocks render with a highlighted outline or full visibility, ignoring occlusion. The mod integrates seamlessly with vanilla rendering, offering a smooth toggle experience without affecting other players or requiring server-side installation.
  1. Add a Fabric 26.2 mod entrypoint and a client-only X-ray toggle key.

  2. Let the player select any block by aiming at it, then highlight matching blocks through terrain, walls, and water.

  3. Add the required mod metadata and keybind feedback.

Created Block Vision, a client-side Fabric 26.2 mod.

  • Aim at a block and press B to select it.

  • Press X to toggle its highlights on or off.

  • Matching blocks within 24 blocks are highlighted through walls, terrain, and water.

The keybinds appear in Minecraft’s Controls menu.

Noah Lee

Add it

Kodari AI
KodariOct 1 at 1:44 am 1

It’s already added to the project: press B while aiming at a block to select it, then X to toggle its highlights through terrain, walls, and water. It scans within 24 blocks.

Kodari can make mistakes. Review important code before using.
Files
src
BlockESP
build.gradle
gradle.properties
settings.gradle
Code
7 194
src/client/java/com/kodari/blockvision/client/BlockVisionClient.java
package com.kodari.blockvision.client;

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.fabricmc.fabric.api.client.rendering.v1.level.LevelRenderEvents;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.gizmos.GizmoStyle;
import net.minecraft.gizmos.Gizmos;
import net.minecraft.network.chat.Component;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;

import java.util.ArrayList;
import java.util.List;

public class BlockVisionClient implements ClientModInitializer {
	private static final int SCAN_RADIUS = 24;
	private static final int SCAN_INTERVAL_TICKS = 10;
	private static final KeyMapping TOGGLE_KEY = KeyMappingHelper.registerKeyMapping(
			new KeyMapping("key.blockvision.toggle", InputConstants.Type.KEYSYM, 88, KeyMapping.Category.MISC));
	private static final KeyMapping SELECT_KEY = KeyMappingHelper.registerKeyMapping(
			new KeyMapping("key.blockvision.select", InputConstants.Type.KEYSYM, 66, KeyMapping.Category.MISC));

	private static boolean enabled;
	private static Block selectedBlock;
	private static List<BlockPos> matchingBlocks = List.of();
	private static Object scannedLevel;
	private static int ticksSinceScan = SCAN_INTERVAL_TICKS;

	@Override
	public void onInitializeClient() {
		ClientTickEvents.END_CLIENT_TICK.register(BlockVisionClient::onClientTick);
		LevelRenderEvents.BEFORE_GIZMOS.register(context -> {
			if (!enabled || Minecraft.getInstance().level != scannedLevel) {
				return;
			}

			for (BlockPos pos : matchingBlocks) {
				Gizmos.cuboid(pos, GizmoStyle.fill(0x66FF9A00)).setAlwaysOnTop();
			}
		});
	}

	private static void onClientTick(Minecraft client) {
		while (TOGGLE_KEY.consumeClick()) {
			enabled = !enabled;
			ticksSinceScan = SCAN_INTERVAL_TICKS;
			if (!enabled) {
				matchingBlocks = List.of();
			}
			if (client.player != null) {
				String state = enabled ? "enabled" : "disabled";
				String selection = selectedBlock == null ? " Select a block with B first." : "";
				client.player.sendSystemMessage(Component.literal("Block Vision " + state + "." + selection));
			}
		}

		while (SELECT_KEY.consumeClick()) {
			if (client.player == null || client.level == null) {
				continue;
			}
			if (client.hitResult instanceof BlockHitResult hit && hit.getType() == HitResult.Type.BLOCK) {
				selectedBlock = client.level.getBlockState(hit.getBlockPos()).getBlock();
				matchingBlocks = List.of();
				ticksSinceScan = SCAN_INTERVAL_TICKS;
				client.player.sendSystemMessage(Component.literal(
						"Selected " + BuiltInRegistries.BLOCK.getKey(selectedBlock) + ". Press X to toggle X-ray."));
			} else {
				client.player.sendSystemMessage(Component.literal("Aim at a block and press B to select it."));
			}
		}

		if (!enabled || client.level == null || client.player == null || selectedBlock == null) {
			matchingBlocks = List.of();
			scannedLevel = client.level;
			ticksSinceScan = 0;
			return;
		}

		if (client.level != scannedLevel || ticksSinceScan >= SCAN_INTERVAL_TICKS) {
			scanForSelectedBlock(client);
			ticksSinceScan = 0;
		} else {
			ticksSinceScan++;
		}
	}

	private static void scanForSelectedBlock(Minecraft client) {
		BlockPos center = client.player.blockPosition();
		int radiusSquared = SCAN_RADIUS * SCAN_RADIUS;
		List<BlockPos> found = new ArrayList<>();

		for (int x = center.getX() - SCAN_RADIUS; x <= center.getX() + SCAN_RADIUS; x++) {
			for (int y = center.getY() - SCAN_RADIUS; y <= center.getY() + SCAN_RADIUS; y++) {
				for (int z = center.getZ() - SCAN_RADIUS; z <= center.getZ() + SCAN_RADIUS; z++) {
					int dx = x - center.getX();
					int dy = y - center.getY();
					int dz = z - center.getZ();
					if (dx * dx + dy * dy + dz * dz > radiusSquared) {
						continue;
					}

					BlockPos pos = new BlockPos(x, y, z);
					if (client.level.getBlockState(pos).getBlock() == selectedBlock) {
						found.add(pos);
					}
				}
			}
		}

		matchingBlocks = found;
		scannedLevel = client.level;
	}
}