Qasem Mahmodi
📎 1 file 1,340 chars
📄
pasted-code-1793032525299.txt
txt 21 lines
▶
Create a Minecraft Fabric mod for version 1.21.11 that highlights all Ancient Debris within a 6-chunk radius around the player.

Features:

Ancient Debris ESP: Detect and highlight every Ancient Debris block within a 6-chunk radius of the player, including blocks hidden behind walls and underground.

White Highlights: Render all detected Ancient Debris blocks with a bright, solid white outline or ESP box. The highlights must be visible through all blocks and terrain.

Pickaxe Highlight: Highlight the player's held pickaxe in bright white in the inventory and hotbar, if technically possible.

Tracer Lines: Draw thin white lines from the player's crosshair or screen center toward the nearest Ancient Debris blocks. Prioritize the closest blocks and update the lines dynamically as the player moves or turns.

Real-Time Updates: Continuously update the highlights and tracer lines as the player moves, so newly loaded Ancient Debris blocks are detected.

Performance: Keep the mod lightweight and optimized to minimize FPS drops.

Configuration: Add a keybind to toggle the ESP and tracer lines on and off.

Build: Generate the complete source code, compile the mod into a working Fabric .jar file, and automatically fix compilation errors.

Make sure the mod works with Minecraft Fabric 1.21.11 and clearly explain how to install it.
Kodari AI
KodariOct 26 at 5:11 pm 8
AncientDebrisESP
Highlights all Ancient Debris blocks within a 6-chunk radius around the player using bright white ESP boxes visible through terrain. Renders tracer lines from screen center toward nearest debris blocks, updating dynamically as the player moves. Highlights held pickaxe in inventory and hotbar. Includes toggle keybind for ESP and tracers. Optimized for performance with efficient chunk scanning and rendering.
  1. Implement client-side debris scanning within six chunks and a keybind toggle.

  2. Render through-wall white boxes and nearest-block tracers, with bounded scan work.

  3. Add Fabric metadata and project build configuration.

Created the Fabric 1.21.11 client mod with K as the toggle. It scans loaded chunks within six chunks, draws white through-wall debris boxes and tracers to the eight nearest blocks, and outlines pickaxes in the inventory and hotbar. Scans are incremental and periodically refreshed; chunks not loaded on the client cannot be inspected.

To build and download the JAR: click Compile in the top bar (on phone, ⋮ → Compile Project), then click Compile in the window. When it succeeds, click Download. To install it, use Fabric for Minecraft 1.21.11, put the JAR in the Minecraft mods folder, and make sure Fabric API is installed too.

Qasem Mahmodi

make an menu that open where u can change settings with the key p and make it that ucan change the key too

Kodari AI
KodariOct 26 at 5:16 pm 2
  1. Add an owo-ui settings screen opened with P, with a control to rebind the ESP toggle.

  2. Persist the selected toggle key and wire both keybinds into the client.

Added the settings menu, opened with P. It lets you enable/disable ESP, toggle tracer lines, adjust the scan radius from 1–6 chunks, and rebind the ESP toggle key: click Set ESP toggle key, then press the new key. Press Esc to cancel rebinding.

The project now includes owo-lib for the menu. Click Compile in Kodari to build the updated JAR, then download it from the successful build.

Qasem Mahmodi

is it done now ?

Kodari AI
KodariOct 26 at 5:16 pm 1

Yes—the settings menu and key rebinding have been added to the project. You’ll need to click Compile in Kodari and download the successful build to get the updated JAR.

Kodari can make mistakes. Review important code before using.
Files
ancient finder
src
build.gradle
gradle.properties
manifest.kod
settings.gradle
Code
14 724
src/client/java/com/kodari/ancientdebrisesp/AncientDebrisEspClient.java
package com.kodari.ancientdebrisesp;

import com.mojang.blaze3d.buffers.GpuBuffer;
import com.mojang.blaze3d.pipeline.BlendFunction;
import com.mojang.blaze3d.pipeline.RenderPipeline;
import com.mojang.blaze3d.platform.DepthTestFunction;
import com.mojang.blaze3d.systems.RenderPass;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.VertexFormat;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gl.Framebuffer;
import net.minecraft.client.gl.UniformType;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.BuiltBuffer;
import net.minecraft.client.render.Tessellator;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.registry.tag.ItemTags;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.chunk.ChunkStatus;
import net.minecraft.world.chunk.ChunkSection;
import net.minecraft.world.chunk.WorldChunk;
import org.joml.Matrix4f;
import org.joml.Vector3f;
import org.joml.Vector4f;
import org.lwjgl.glfw.GLFW;

import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.OptionalInt;
import java.util.Set;

public final class AncientDebrisEspClient implements ClientModInitializer {
    private static int radiusChunks = 6;
    private static final int RESCAN_INTERVAL_TICKS = 200;
    private static final int TRACER_COUNT = 8;
    public static final KeyBinding TOGGLE_KEY = KeyBindingHelper.registerKeyBinding(new KeyBinding(
            "key.ancientdebrisesp.toggle",
            GLFW.GLFW_KEY_K,
            KeyBinding.Category.create(Identifier.of("ancientdebrisesp", "general"))
    ));
    private static final RenderPipeline ESP_PIPELINE = RenderPipeline.builder()
            .withLocation("ancientdebrisesp:esp")
            .withVertexShader("core/position_color")
            .withFragmentShader("core/position_color")
            .withUniform("DynamicTransforms", UniformType.UNIFORM_BUFFER)
            .withUniform("Projection", UniformType.UNIFORM_BUFFER)
            .withBlend(BlendFunction.TRANSLUCENT)
            .withDepthTestFunction(DepthTestFunction.NO_DEPTH_TEST)
            .withDepthWrite(false)
            .withCull(false)
            .withVertexFormat(VertexFormats.POSITION_COLOR, VertexFormat.DrawMode.QUADS)
            .build();

    private static final Set<BlockPos> DEBRIS = new HashSet<>();
    private static final Map<Long, Integer> LAST_SCAN_TICK = new HashMap<>();
    private static ClientWorld trackedWorld;
    private static int ticks;
    private static boolean enabled = true;
    private static boolean tracersEnabled = true;

    @Override
    public void onInitializeClient() {
        ClientTickEvents.END_CLIENT_TICK.register(AncientDebrisEspClient::tick);
        AncientDebrisEspSettingsClient.initialize();
    }

    public static boolean isEnabled() {
        return enabled;
    }

    public static void setEnabled(boolean enabled) {
        AncientDebrisEspClient.enabled = enabled;
    }

    public static boolean areTracersEnabled() {
        return tracersEnabled;
    }

    public static void setTracersEnabled(boolean enabled) {
        tracersEnabled = enabled;
    }

    public static int getRadiusChunks() {
        return radiusChunks;
    }

    public static void setRadiusChunks(int radiusChunks) {
        AncientDebrisEspClient.radiusChunks = Math.clamp(radiusChunks, 1, 6);
    }

    private static void tick(MinecraftClient client) {
        while (TOGGLE_KEY.wasPressed()) {
            enabled = !enabled;
        }

        ClientWorld world = client.world;
        ClientPlayerEntity player = client.player;
        if (world == null || player == null) {
            clearWorldData();
            return;
        }

        if (trackedWorld != world) {
            clearWorldData();
            trackedWorld = world;
            ticks = 0;
        }

        ticks++;
        if (!enabled) {
            return;
        }

        ChunkPos playerChunk = player.getChunkPos();
        int centerX = playerChunk.x;
        int centerZ = playerChunk.z;
        DEBRIS.removeIf(pos -> {
            int chunkX = pos.getX() >> 4;
            int chunkZ = pos.getZ() >> 4;
            int dx = chunkX - centerX;
            int dz = chunkZ - centerZ;
            if (dx * dx + dz * dz > radiusChunks * radiusChunks) {
                return true;
            }

            WorldChunk chunk = world.getChunkManager().getChunk(chunkX, chunkZ, ChunkStatus.FULL, false);
            return chunk == null || !chunk.getBlockState(pos).isOf(Blocks.ANCIENT_DEBRIS);
        });

        LAST_SCAN_TICK.keySet().removeIf(key -> {
            int dx = chunkX(key) - centerX;
            int dz = chunkZ(key) - centerZ;
            return dx * dx + dz * dz > radiusChunks * radiusChunks;
        });

        scanOneChunk(world, centerX, centerZ);
    }

    private static void scanOneChunk(ClientWorld world, int centerX, int centerZ) {
        for (int dx = -radiusChunks; dx <= radiusChunks; dx++) {
            for (int dz = -radiusChunks; dz <= radiusChunks; dz++) {
                if (dx * dx + dz * dz > radiusChunks * radiusChunks) {
                    continue;
                }

                int chunkX = centerX + dx;
                int chunkZ = centerZ + dz;
                long key = chunkKey(chunkX, chunkZ);
                Integer lastScan = LAST_SCAN_TICK.get(key);
                if (lastScan != null && ticks - lastScan < RESCAN_INTERVAL_TICKS) {
                    continue;
                }

                WorldChunk chunk = world.getChunkManager().getChunk(chunkX, chunkZ, ChunkStatus.FULL, false);
                if (chunk == null) {
                    continue;
                }

                scanChunk(world, chunk, chunkX, chunkZ, key);
                LAST_SCAN_TICK.put(key, ticks);
                return;
            }
        }
    }

    private static void scanChunk(ClientWorld world, WorldChunk chunk, int chunkX, int chunkZ, long key) {
        DEBRIS.removeIf(pos -> chunkKey(pos.getX() >> 4, pos.getZ() >> 4) == key);

        ChunkSection[] sections = chunk.getSectionArray();
        int blockX = chunkX << 4;
        int blockZ = chunkZ << 4;
        for (int sectionIndex = 0; sectionIndex < sections.length; sectionIndex++) {
            ChunkSection section = sections[sectionIndex];
            if (section == null || section.isEmpty() || !section.hasAny(state -> state.isOf(Blocks.ANCIENT_DEBRIS))) {
                continue;
            }

            int blockY = world.sectionIndexToCoord(sectionIndex) << 4;
            for (int localY = 0; localY < 16; localY++) {
                for (int localZ = 0; localZ < 16; localZ++) {
                    for (int localX = 0; localX < 16; localX++) {
                        BlockState state = section.getBlockState(localX, localY, localZ);
                        if (state.isOf(Blocks.ANCIENT_DEBRIS)) {
                            DEBRIS.add(new BlockPos(blockX + localX, blockY + localY, blockZ + localZ));
                        }