make me a mod that will give the player a INVENTORY GUI that is reactive that is binded to the END key and they can pick any block in the game and it will highlite it through walls in dark blue and make it have a slider for colors
Now I have a solid understanding of the APIs. Let me plan this out:
Plan:
BlockHighlightMod.java— main initializer (empty, client-only mod)BlockHighlightClient.java— registers keybinding + HUD overlayBlockHighlightScreen.java— inventory GUI with block search, color slidersBlockHighlightState.java— shared state (selected block, color)BlockHighlightRenderer.java— world render mixin to draw ESP highlight through wallsWorldRendererMixin.java— hooks into world rendering to draw outlinesBuild files + resources
The highlight-through-walls effect requires a mixin into the world renderer to draw colored outlines using RenderLayer with depth test disabled.
Now the main client initializer:
Now the world renderer mixin that draws the ESP highlight through walls:
Now I need to check the exact WorldRenderer.render method signature for the mixin target:The sub-agent confirmed the approach. Now let me also check the exact WorldRenderer.render() method signature for the mixin, and verify the WorldRenderEvents situation since the breaking_change_guide says they were re-added in 1.21.11:
I have enough information to build this correctly. The WorldRenderEvents API is confirmed re-added in 1.21.11. I’ll use WorldRenderEvents.LAST for the ESP rendering since it fires after all world geometry, and use RenderSystem.disableDepthTest() for the through-walls effect. Let me now write all the files:
Now I need to verify that BufferBuilder.endNullable() exists in 1.21.11 — if the buffer has no vertices it would crash with end(). Let me use a safe approach:
endNullable() exists and returns MeshData (class_9801). Now let me check the WorldRenderContext interface:
The repo is fabric-api not fabric. Let me try the correct URL:
The repo is FabricMC/fabric-api but the branch is 26.2 (for 26.x / post-1.21.11). I need the 1.21.11 branch. Let me look for the correct tag:
The current main branch is for 26.x (post-1.21.11). I need to find the 1.21.11 branch. Since WorldRenderEvents are confirmed re-added in 1.21.11 per the learning docs, I’ll use a safe mixin-based approach that avoids the WorldRenderContext API uncertainty. I’ll use a direct WorldRenderer mixin with @Inject at TAIL — this is the most reliable approach and avoids any API version concerns.
Now I have all the information I need. Let me write all the files:
Now I need to verify the exact WorldRenderer.render method signature in Yarn 1.21.11 to make sure the mixin descriptor matches:
Now I have the exact render method signature. It’s method_22710 with descriptor:
render(Lnet/minecraft/class_9922;Lnet/minecraft/class_9779;ZLnet/minecraft/class_4184;Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lcom/mojang/blaze3d/buffers/GpuBufferSlice;Lorg/joml/Vector4f;Z)V
The world field is field_4085 → world (type ClientWorld). Now I also need to check what Camera maps to and what ShaderProgramKeys looks like in 1.21.11:
Good — the project already has files! Let me check what’s there:
The project already has files from previous (failed) creation attempts. Let me read all of them to understand what’s there and what needs to be fixed:
The project files are already there. Now I need to fix the critical issue: the WorldRendererMixin has the wrong method signature for render(). Based on the Yarn mapping I fetched, the actual render method in 1.21.11 is:
render(Lnet/minecraft/class_9922;Lnet/minecraft/class_9779;ZLnet/minecraft/class_4184;Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lcom/mojang/blaze3d/buffers/GpuBufferSlice;Lorg/joml/Vector4f;Z)V
The current mixin has completely wrong parameters. I need to fix the mixin to use the correct descriptor. Also, the render method takes a FrameGraphAllocator (class_9922), RenderTickCounter (class_9779), Camera (class_4184), three Matrix4f, a GpuBufferSlice, a Vector4f, and a boolean. The current mixin parameters don’t match at all.
The safest fix is to use the full method descriptor in the @Inject annotation and use @At("TAIL") with no parameter capture (just CallbackInfo):
Now I need to check if net.minecraft.class_9922 is accessible as a direct reference in Java code. Since we’re using Yarn mappings, the intermediary class names shouldn’t be used directly — Yarn should map class_9922 to a proper name. Let me check what class_9922 maps to:
So class_9922 is the FrameGraphAllocator. Let me find its Yarn name:
The key insight is: in the @Inject method descriptor, I’m using intermediary names (like Lnet/minecraft/class_9922;) which is correct for mixin descriptors — Mixin resolves these against the intermediary-mapped bytecode. The Java parameter types in the handler method, however, need to use Yarn-mapped names that compile.
The problem is I’m using net.minecraft.class_9922 directly in the Java handler signature, which won’t compile. I need to either:
Find the Yarn name for
class_9922, orUse
Objectfor unknown types, orSimply not capture those parameters (use
@At("TAIL")with justCallbackInfoand no params)
The cleanest solution is option 3 — since I only need the positionMatrix (5th param, index 4), I can use @At("TAIL") and get the matrix from MinecraftClient instead. Actually, the best approach is to just not capture any parameters and get the camera position from MinecraftClient.getInstance() directly in the renderer, which is already what BlockHighlightRenderer.render() does.
Let me simplify the mixin to have no parameters at all:
Now I also need to update BlockHighlightRenderer since it no longer receives a MatrixStack with the position matrix applied. Instead, it needs to build its own transform from the camera position. The current renderer already does this correctly — it offsets all vertices by camPos (subtracting camera position from world coordinates), so the MatrixStack just needs to be identity. The current code is already correct for this approach.
However, there’s one issue: state.getOutlineShape(world, pos).getBoundingBox() will throw if the shape is empty (e.g., air blocks that somehow pass the filter). Let me also check if BufferRenderer.drawWithGlobalProgram accepts a nullable MeshData:
The endNullable() method returns MeshData (nullable), and the renderer already handles the null case by checking hasVertices. But BufferRenderer.drawWithGlobalProgram(buffer.endNullable()) — if endNullable() returns null when there are no vertices, passing null to drawWithGlobalProgram would crash. The current code already guards this with if (hasVertices) and calls buffer.endNullable() in both branches. That’s correct.
Now let me also fix the BlockHighlightRenderer to handle the case where getOutlineShape returns an empty shape (which would throw on getBoundingBox()):
Now let me also verify the fabric.mod.json doesn’t have a main entrypoint — since this is client-only, it should only have client. Let me also check if BlockHighlightMod.java is needed at all. Since fabric.mod.json only has client entrypoint, the BlockHighlightMod.java in src/main is unused but harmless. However, the fabric.mod.json doesn’t reference it, so it’s fine.
Let me do a final review of all files to make sure everything is consistent:
The lang file has a key.categories.blockesphighlighter entry but the KeyBinding.Category in 1.21.11 is Identifier-based (not translation-key-based). That entry is harmless but unused. The actual category translation key would be key.categories.blockesphighlighter.main based on the Identifier blockesphighlighter:main. Let me update the lang file to match:
Everything looks solid. Here’s a summary of the complete mod:
Block ESP Highlighter — complete and ready to build.
How it works
Component | What it does |
|---|---|
BlockHighlightClient | Registers the END keybinding (Identifier-based category, 1.21.9+ API) and opens the screen on press |
BlockHighlightScreen | Reactive inventory GUI — 9×5 block grid, live search field, 3 RGB sliders with drag support, scrollbar, tooltips, color preview box |
BlockHighlightState | Shared static state (selected block + RGB floats) with JSON persistence in the config folder |
BlockHighlightRenderer | Scans 64-block radius around the player each frame, draws 12-edge wireframe boxes with DEBUG_LINES + POSITION_COLOR shader, RenderSystem.disableDepthTest() for through-wall visibility |
WorldRendererMixin | Injects at @At("TAIL") of WorldRenderer.render() using the exact Yarn 1.21.11 intermediary descriptor to trigger the renderer each frame |
Usage
Press END to open the block picker
Type in the search box to filter — the grid updates live
Click any block to select it (click again to deselect)
Drag the R / G / B sliders to change the highlight color
Close the screen — matching blocks within 64 blocks glow through walls
package com.blockesphighlighter;
import net.fabricmc.api.ModInitializer;
public class BlockHighlightMod implements ModInitializer {
public static final String MOD_ID = "blockesphighlighter";
@Override
public void onInitialize() {
}
}