Radim Poruba

Hi, I’d like to create a highlighter that marks respawn anchors, both in singleplayer and multiplayer.

Kodari AI
KodariOct 27 at 4:35 pm 2
RespawnAnchorHighlighter
Highlights respawn anchors in both singleplayer and multiplayer worlds. Renders a visible outline or glow effect around all placed respawn anchors, making them easy to locate. Works client-side for singleplayer and server-side for multiplayer, with configurable highlight color, style, and toggle keybind. Supports dimension-specific highlighting and respects anchor charge states.
  1. Create a client-side Fabric mod that highlights loaded respawn anchors in both singleplayer and multiplayer.

  2. Add the 26.2 project metadata and a world-render callback that draws visible markers.

Created a client-side Fabric 26.2 mod that draws an orange wireframe around nearby respawn anchors in singleplayer and multiplayer. It refreshes its search every second, checking loaded areas within 24 blocks horizontally and 16 vertically; only the client needs the mod.

Radim Poruba

Rewrite this mod to act as a proper "Block Finder". I need an in-game GUI or chat command config to change the target block dynamically.

Please update the project to meet these requirements for Minecraft 26.2 (Fabric):

  1. Create a configurations class or a system to store a list of target Block IDs (e.g., TargetBlockList).
  2. Add a simple chat command (handled purely client-side via ClientCommandRegistrationCallback) like /find <block_id> to add blocks to the finder, and /find clear to reset it.
  3. Update the world-render callback (WorldRenderEvents.LAST) so it loops through the registered target blocks dynamically instead of hardcoding just the respawn anchor.
  4. Keep the depth test disabled (RenderSystem.disableDepthTest()) so the box outlines remain visible through walls and obsidian.
Kodari AI
KodariOct 27 at 4:52 pm 3
  1. Inspect the current finder implementation and project setup.

  2. Verify the exact 26.2 client-command and world-render APIs.

  3. Add dynamic block-ID targets and /find commands, keeping outlines visible through blocks.

Updated the mod to Block Finder. Use /find minecraft:diamond_ore to add a block ID, and /find clear to remove all targets. It scans loaded areas within 24 blocks horizontally and 16 vertically; the target list currently lasts for the client session.

Minecraft 26.2 has no WorldRenderEvents.LAST or RenderSystem.disableDepthTest(). I used its current LevelRenderEvents.COLLECT_SUBMITS event and a custom pipeline with depth testing omitted, so outlines remain visible through walls and obsidian.

Radim Poruba

That's awesome! Before showing me the code, please increase the scan radius. Change it to scan within 64 blocks horizontally and 64 blocks vertically (or covering from min Y to max Y) so I can actually find hidden bases. After that, please output the complete updated code for the files and tell me the command to build the .jar.

Kodari AI
KodariOct 27 at 6:09 pm 1

Updated RespawnAnchorHighlighterClient.java: the finder now scans within 64 blocks horizontally and 64 vertically of you. The complete updated file is in the project.

To build the .jar, click Compile in the top bar (on phone: ⋮ → Compile Project), then click Compile in the window. When it succeeds, click Download on the build.

Radim Poruba

The custom renderer mod you made doesn't have the same features. Can you decompile this original mod jar file that I'm uploading, find the class that blocks multiplayer (the one causing the "disabled on multiplayer servers" message), remove that specific check/restriction, and then recompile it back into a working .jar for Minecraft 26.2? I want the exact original Block Finder mod, just with the multiplayer bypass.

Kodari AI
KodariOct 27 at 6:19 pm 1

I can’t remove a multiplayer restriction to enable hidden-base scanning or bypass a server’s rules. I can help recreate the original mod’s features in your custom finder while keeping multiplayer use limited to servers that explicitly authorize it, and leave it available in singleplayer.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
8 345
src/client/java/com/example/respawnanchorhighlighter/RespawnAnchorHighlighterClient.java
package com.example.respawnanchorhighlighter;

import java.util.HashSet;
import java.util.Optional;
import java.util.Set;

import com.mojang.blaze3d.PrimitiveTopology;
import com.mojang.blaze3d.pipeline.BlendFunction;
import com.mojang.blaze3d.pipeline.ColorTargetState;
import com.mojang.blaze3d.pipeline.RenderPipeline;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.brigadier.arguments.StringArgumentType;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
import net.fabricmc.fabric.api.client.command.v2.ClientCommands;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.rendering.v1.level.LevelRenderEvents;
import net.fabricmc.fabric.api.client.rendering.v1.level.LevelRenderContext;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.renderer.BindGroupLayouts;
import net.minecraft.client.renderer.rendertype.RenderSetup;
import net.minecraft.client.renderer.rendertype.RenderType;
import net.minecraft.core.BlockPos;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.Identifier;
import net.minecraft.world.phys.Vec3;
import net.minecraft.world.level.block.Block;

import com.example.respawnanchorhighlighter.mixin.RenderTypeAccessor;

public class RespawnAnchorHighlighterClient implements ClientModInitializer {
	private static final int HORIZONTAL_RADIUS = 64;
	private static final int VERTICAL_RADIUS = 64;
	private static final int REFRESH_INTERVAL_TICKS = 20;
	private static final Set<BlockPos> NO_POSITIONS = Set.of();
	private static final RenderPipeline FINDER_LINES_PIPELINE = RenderPipeline.builder()
			.withLocation("block_finder:finder_lines")
			.withBindGroupLayout(BindGroupLayouts.GLOBALS)
			.withBindGroupLayout(BindGroupLayouts.MATRICES_PROJECTION)
			.withBindGroupLayout(BindGroupLayouts.FOG)
			.withVertexShader("core/rendertype_lines")
			.withFragmentShader("core/rendertype_lines")
			.withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
			.withCull(false)
			.withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR_NORMAL_LINE_WIDTH)
			.withPrimitiveTopology(PrimitiveTopology.LINES)
			.withDepthStencilState(Optional.empty())
			.build();
	private static final RenderType FINDER_LINES = RenderTypeAccessor.blockFinder$create(
			"block_finder_finder_lines",
			RenderSetup.builder(FINDER_LINES_PIPELINE).createRenderSetup()
	);

	private static ClientLevel scannedLevel;
	private static Set<BlockPos> foundPositions = NO_POSITIONS;
	private static Set<Block> activeTargets = Set.of();
	private static int ticksUntilRefresh;

	@Override
	public void onInitializeClient() {
		ClientCommandRegistrationCallback.EVENT.register((dispatcher, buildContext) -> dispatcher.register(
				ClientCommands.literal("find")
						.then(ClientCommands.literal("clear").executes(context -> {
							TargetBlockList.clear();
							resetTargets();
							context.getSource().sendFeedback(Component.literal("Block finder targets cleared."));
							return 1;
						}))
						.then(ClientCommands.argument("block_id", StringArgumentType.word()).executes(context -> {
							String input = StringArgumentType.getString(context, "block_id");
							Identifier id = Identifier.tryParse(input);
							if (id == null || BuiltInRegistries.BLOCK.getOptional(id).isEmpty()) {
								context.getSource().sendError(Component.literal("Unknown block ID: " + input));
								return 0;
							}

							if (!TargetBlockList.add(id)) {
								context.getSource().sendFeedback(Component.literal("Already finding " + id + "."));
								return 1;
							}

							resetTargets();
							context.getSource().sendFeedback(Component.literal("Added " + id + " to the block finder."));
							return 1;
						}))
		));
		ClientTickEvents.END_CLIENT_TICK.register(RespawnAnchorHighlighterClient::refreshTargets);
		LevelRenderEvents.COLLECT_SUBMITS.register(RespawnAnchorHighlighterClient::renderTargets);
	}

	private static void resetTargets() {
		activeTargets = TargetBlockList.resolveTargets();
		foundPositions = NO_POSITIONS;
		ticksUntilRefresh = 0;
	}

	private static void refreshTargets(Minecraft client) {
		if (client.level == null || client.player == null) {
			scannedLevel = null;
			foundPositions = NO_POSITIONS;
			ticksUntilRefresh = 0;
			return;
		}

		if (client.level != scannedLevel) {
			scannedLevel = client.level;
			foundPositions = NO_POSITIONS;
			ticksUntilRefresh = 0;
		}

		if (ticksUntilRefresh-- > 0) {
			return;
		}
		ticksUntilRefresh = REFRESH_INTERVAL_TICKS;

		ClientLevel level = client.level;
		activeTargets = TargetBlockList.resolveTargets();
		if (activeTargets.isEmpty()) {
			foundPositions = NO_POSITIONS;
			return;
		}

		BlockPos center = client.player.blockPosition();
		int minX = center.getX() - HORIZONTAL_RADIUS;
		int maxX = center.getX() + HORIZONTAL_RADIUS;
		int minY = Math.max(level.getMinY(), center.getY() - VERTICAL_RADIUS);
		int maxY = Math.min(level.getMaxY(), center.getY() + VERTICAL_RADIUS);
		int minZ = center.getZ() - HORIZONTAL_RADIUS;
		int maxZ = center.getZ() + HORIZONTAL_RADIUS;
		BlockPos.MutableBlockPos scanPosition = new BlockPos.MutableBlockPos(0, 0, 0);
		Set<BlockPos> found = new HashSet<>();

		for (int x = minX; x <= maxX; x++) {
			for (int y = minY; y <= maxY; y++) {
				for (int z = minZ; z <= maxZ; z++) {
					scanPosition.set(x, y, z);
					if (level.isLoaded(scanPosition) && activeTargets.contains(level.getBlockState(scanPosition).getBlock())) {
						found.add(scanPosition.immutable());
					}
				}
			}
		}

		foundPositions = Set.copyOf(found);
	}

	private static void renderTargets(LevelRenderContext context) {
		PoseStack poseStack = context.poseStack();
		Minecraft client = Minecraft.getInstance();
		if (poseStack == null || client.level == null || client.level != scannedLevel || foundPositions.isEmpty()) {
			return;
		}

		ClientLevel level = client.level;
		Vec3 cameraPosition = context.levelState().cameraRenderState.pos;
		for (BlockPos position : foundPositions) {
			if (!level.isLoaded(position) || !activeTargets.contains(level.getBlockState(position).getBlock())) {
				continue;
			}

			float x = (float) (position.getX() - cameraPosition.x());
			float y = (float) (position.getY() - cameraPosition.y());
			float z = (float) (position.getZ() - cameraPosition.z());
			context.submitNodeCollector().submitCustomGeometry(poseStack, FINDER_LINES, (pose, buffer) -> drawTargetBox(pose, buffer, x, y, z));
		}
	}

	private static void drawTargetBox(PoseStack.Pose pose, VertexConsumer buffer, float x, float y, float z) {
		float min = 0.002F;
		float max = 0.998F;
		float x0 = x + min;
		float y0 = y + min;
		float z0 = z + min;
		float x1 = x + max;
		float y1 = y + max;
		float z1 = z + max;

		addLine(pose, buffer, x0, y0, z0, x1, y0, z0);
		addLine(pose, buffer, x1, y0, z0, x1, y0, z1);
		addLine(pose, buffer, x1, y0, z1, x0, y0, z1);
		addLine(pose, buffer, x0, y0, z1, x0, y0, z0);
		addLine(pose, buffer, x0, y1, z0, x1, y1, z0);
		addLine(pose, buffer, x1, y1, z0, x1, y1, z1);
		addLine(pose, buffer, x1, y1, z1, x0, y1, z1);
		addLine(pose, buffer, x0, y1, z1, x0, y1, z0);
		addLine(pose, buffer, x0, y0, z0, x0, y1, z0);
		addLine(pose, buffer, x1, y0, z0, x1, y1, z0);
		addLine(pose, buffer, x1, y0, z1, x1, y1, z1);
		addLine(pose, buffer, x0, y0, z1, x0, y1, z1);
	}

	private static void addLine(PoseStack.Pose pose, VertexConsumer buffer, float x1, float y1, float z1, float x2, float y2, float z2) {
		buffer.addVertex(pose, x1, y1, z1)
				.setColor(1.0F, 0.58F, 0.12F, 1.0F)
				.setNormal(pose, 0.0F, 1.0F, 0.0F)
				.setLineWidth(2.5F);