Γιαννης

Create a Fabric client-side Minecraft Java 26.2 mod JAR. Add a toggleable highlight system for Chests, Trapped Chests, Shulker Boxes, Pistons, Anvils, Hoppers, Observers, and Armor Stands. Press I to enable and I again to disable. Highlights must be visible through solid blocks. Show ONLY the highlights: no text, names, coordinates, HUD, GUI, particles, sounds, or commands. Only detect and render targets in the player's current chunk and the 5 nearest chunks. Dynamically update this area when the player changes chunks and remove targets outside it. Use cached results and rescan only when necessary to keep FPS impact very low. Handle chunk loading/unloading safely and never scan the entire world. Make it client-side and compatible ONLY with Minecraft Java 26.2 Fabric. Do not add packet manipulation, anti-cheat bypasses, injection, or detection-evasion features. Output a working compiled .jar and complete source project.

Kodari AI
KodariSep 24 at 2:56 pm 8
ChunkHighlightScanner
Client-side Fabric mod for Minecraft 26.2 that renders persistent glowing outlines around Chests, Trapped Chests, Shulker Boxes, Pistons, Anvils, Hoppers, Observers, and Armor Stands. Toggle with the I key. Highlights render through solid blocks using depth-buffer manipulation. Scans only the player's current chunk plus five nearest chunks, caching block positions and rescanning only on chunk changes or block updates. Dynamically tracks chunk loading/unloading, removing targets outside the active area. No HUD, text, sounds, or commands—pure visual highlighting optimized for minimal FPS impact.
  1. Create a client-only Fabric 26.2 project and keybind.

  2. Implement chunk-bounded, cached target tracking with safe load/unload and block-change invalidation.

  3. Render through-wall highlights only, then package the source project.

Created the Fabric 26.2 client mod source project. Press I to toggle highlights for chests, trapped chests, all shulker boxes, pistons, anvils, hoppers, observers, and armor stands. Tracking is limited to the current chunk and five nearest chunks, uses non-loading chunk lookups, and refreshes cached block results on chunk changes.

The project is configured to build with gradle jar; the expected output is build/libs/chunk-highlights-1.0.0.jar. A compiled JAR wasn’t generated or attached here—only project files could be created in this environment.

Γιαννης

it doesnt work

Kodari AI
KodariSep 24 at 3:12 pm 3

The previous delivery did not include a compiled JAR; it only created the source project. What fails when you try it: does Gradle report an error, does pressing I do nothing, or do highlights fail to appear? If it’s a build error, paste the first error; if it launches, share the relevant part of latest.log.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
7 445
src/client/java/io/kodari/chunkhighlights/ChunkHighlightsClient.java
package io.kodari.chunkhighlights;

import com.mojang.blaze3d.platform.InputConstants;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientChunkEvents;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientEntityEvents;
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.client.multiplayer.ClientLevel;
import net.minecraft.client.renderer.gizmos.DrawableGizmoPrimitives;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.decoration.ArmorStand;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraft.world.level.chunk.LevelChunkSection;
import net.minecraft.world.level.chunk.status.ChunkStatus;
import net.minecraft.world.level.entity.EntityTypeTest;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
import org.lwjgl.glfw.GLFW;

public final class ChunkHighlightsClient implements ClientModInitializer {
	private static final int HIGHLIGHT_COLOR = 0xFFFFB000;
	private static final float LINE_WIDTH = 2.5F;
	private static final int[][] BOX_EDGES = {
		{0, 1}, {0, 2}, {0, 4}, {1, 3}, {1, 5}, {2, 3},
		{2, 6}, {3, 7}, {4, 5}, {4, 6}, {5, 7}, {6, 7}
	};
	private static final Set<Block> TARGET_BLOCKS = createTargetBlocks();
	private static final KeyMapping TOGGLE_KEY = KeyMappingHelper.registerKeyMapping(
		new KeyMapping(
			"key.chunkhighlights.toggle",
			InputConstants.Type.KEYSYM,
			GLFW.GLFW_KEY_I,
			KeyMapping.Category.MISC
		)
	);
	private static final Map<ChunkKey, List<BlockPos>> blockTargets = new HashMap<>();
	private static final Set<ChunkKey> dirtyChunks = new HashSet<>();
	private static final Set<ArmorStand> armorStands = new HashSet<>();
	private static Set<ChunkKey> activeChunks = Set.of();
	private static ClientLevel trackedLevel;
	private static boolean enabled;

	@Override
	public void onInitializeClient() {
		ClientTickEvents.END_CLIENT_TICK.register(ChunkHighlightsClient::tick);
		ClientChunkEvents.CHUNK_LOAD.register(ChunkHighlightsClient::onChunkLoad);
		ClientChunkEvents.CHUNK_UNLOAD.register(ChunkHighlightsClient::onChunkUnload);
		ClientEntityEvents.ENTITY_LOAD.register(ChunkHighlightsClient::onEntityLoad);
		ClientEntityEvents.ENTITY_UNLOAD.register(ChunkHighlightsClient::onEntityUnload);
		LevelRenderEvents.COLLECT_SUBMITS.register(ChunkHighlightsClient::renderHighlights);
	}

	private static void tick(Minecraft client) {
		while (TOGGLE_KEY.consumeClick()) {
			enabled = !enabled;
			if (!enabled) {
				clearTracking();
			}
		}

		ClientLevel level = client.level;
		if (level == null || client.player == null) {
			trackedLevel = null;
			clearTracking();
			return;
		}

		if (trackedLevel != level) {
			clearTracking();
			trackedLevel = level;
		}
		if (!enabled) {
			return;
		}

		ChunkPos playerChunk = client.player.chunkPosition();
		List<ChunkKey> nearbyChunks = findNearbyChunks(playerChunk.x(), playerChunk.z());
		Set<ChunkKey> nextActiveChunks = new LinkedHashSet<>(nearbyChunks);
		if (!nextActiveChunks.equals(activeChunks)) {
			activeChunks = nextActiveChunks;
			blockTargets.keySet().retainAll(activeChunks);
			dirtyChunks.retainAll(activeChunks);
			for (ChunkKey key : activeChunks) {
				if (!blockTargets.containsKey(key)) {
					dirtyChunks.add(key);
				}
			}
			refreshArmorStands(level);
		}

		rescanOneDirtyChunk(level);
		armorStands.removeIf(stand -> !activeChunks.contains(keyOf(stand.chunkPosition())));
	}

	private static void renderHighlights(net.fabricmc.fabric.api.client.rendering.v1.level.LevelRenderContext context) {
		if (!enabled || trackedLevel == null || Minecraft.getInstance().level != trackedLevel) {
			return;
		}

		DrawableGizmoPrimitives gizmos = new DrawableGizmoPrimitives();
		boolean hasHighlights = false;
		for (ChunkKey key : activeChunks) {
			List<BlockPos> positions = blockTargets.get(key);
			if (positions == null) {
				continue;
			}
			for (BlockPos pos : positions) {
				addBox(gizmos, pos.getX(), pos.getY(), pos.getZ(), pos.getX() + 1.0, pos.getY() + 1.0, pos.getZ() + 1.0);
				hasHighlights = true;
			}
		}

		for (ArmorStand stand : armorStands) {
			if (!activeChunks.contains(keyOf(stand.chunkPosition()))) {
				continue;
			}
			AABB bounds = stand.getBoundingBox();
			addBox(gizmos, bounds.minX, bounds.minY, bounds.minZ, bounds.maxX, bounds.maxY, bounds.maxZ);
			hasHighlights = true;
		}

		if (hasHighlights) {
			gizmos.submit(
				context.submitNodeCollector(),
				context.levelState().cameraRenderState,
				true
			);
		}
	}

	private static void addBox(DrawableGizmoPrimitives gizmos, double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {
		Vec3[] corners = {
			new Vec3(minX, minY, minZ),
			new Vec3(maxX, minY, minZ),
			new Vec3(minX, maxY, minZ),
			new Vec3(maxX, maxY, minZ),
			new Vec3(minX, minY, maxZ),
			new Vec3(maxX, minY, maxZ),
			new Vec3(minX, maxY, maxZ),
			new Vec3(maxX, maxY, maxZ)
		};
		for (int[] edge : BOX_EDGES) {
			gizmos.addLine(corners[edge[0]], corners[edge[1]], HIGHLIGHT_COLOR, LINE_WIDTH);
		}
	}

	private static void onChunkLoad(ClientLevel level, LevelChunk chunk) {
		if (!enabled || trackedLevel != level) {
			return;
		}
		ChunkKey key = keyOf(chunk.getPos());
		if (activeChunks.contains(key)) {
			blockTargets.remove(key);
			dirtyChunks.add(key);
			addArmorStandsInChunk(level, key);
		}
	}

	private static void onChunkUnload(ClientLevel level, LevelChunk chunk) {
		if (trackedLevel != level) {
			return;
		}
		ChunkKey key = keyOf(chunk.getPos());
		blockTargets.remove(key);
		dirtyChunks.remove(key);
		armorStands.removeIf(stand -> keyOf(stand.chunkPosition()).equals(key));
	}

	private static void onEntityLoad(net.minecraft.world.entity.Entity entity, ClientLevel level) {
		if (enabled && trackedLevel == level && entity instanceof ArmorStand stand && activeChunks.contains(keyOf(stand.chunkPosition()))) {
			armorStands.add(stand);
		}
	}

	private static void onEntityUnload(net.minecraft.world.entity.Entity entity, ClientLevel level) {
		if (trackedLevel == level && entity instanceof ArmorStand stand) {
			armorStands.remove(stand);
		}
	}

	public static void onBlockChanged(ChunkPos pos) {
		if (!enabled) {
			return;
		}