bob bob
📎 1 file 4,381 chars
📄
pasted-code-1794165352859.txt
txt 262 lines
▶
Build a complete, standalone Minecraft Java Edition client-side mod called Donut Hunter.

1. Technical requirements

Minecraft Java Edition: 1.21.11

Mod loader: Fabric

Language: Java

Standalone Fabric client mod.

Do NOT require Meteor Client or any other client.

Use compatible Fabric API and Fabric Loom versions.

Target Java 21 or the Java version required by Minecraft 1.21.11.

Generate all source files, resources, textures and configuration files.

Compile the project and fix all compilation errors.

Deliver a working downloadable JAR.

2. User interface

Create a beautiful ClickGUI:

Open and close with Right Shift.

Dark black and purple theme.

Smooth animations.

Category navigation.

Search bar for modules.

Toggle switches.

Sliders and dropdown settings.

Module descriptions.

Save settings automatically.

Categories:

Combat

Render

World

Utility

Exploration

3. SOUND RADAR

Create an advanced sound visualization module.

Features:

Detect Minecraft sound events.

Show sound direction.

Estimate distance where possible.

Display sounds on a circular radar.

Show sound names.

Display sound timestamps.

Configurable radar size.

Configurable detection range.

Highlight suspicious underground sounds below Y=0.

Do not fabricate sound events or claim that sounds identify a base with certainty.

4. BASE DETECTOR

Create a suspicious-area detection system.

Features:

Detect unusual clusters of visible storage blocks.

Detect visible furnaces, chests and other player-placed blocks where identifiable.

Analyze suspicious tunnels and structures using available client-side information.

Give suspicious locations a score.

Display approximate coordinates.

Save discovered locations.

5. DIAMOND ESP

Create a configurable diamond visualization module.

Features:

Highlight diamond ore and deepslate diamond ore when their positions are available to the client.

Different colors for different ore types.

Show coordinates and distance.

Toggle individual ore types.

Configurable rendering distance.

Do not bypass server anti-xray or reveal hidden blocks that the server does not send to the client.

6. ANCIENT DEBRIS ESP

Features:

Highlight visible ancient debris.

Configurable colors.

Display coordinates.

Distance indicators.

Adjustable rendering range.

Only use block information legitimately available to the client.

7. STASH FINDER

Features:

Analyze visible storage block concentrations.

Detect suspicious clusters of chests and barrels.

Assign a suspicion score.

Display coordinates.

Save findings.

Avoid duplicate discoveries.

8. CHUNK FINDER

Features:

Display chunk borders.

Show chunk coordinates.

Mark explored chunks.

Track suspicious patterns using available information.

Save interesting locations.

9. COORDINATE LOGGER

Features:

Automatically record manually discovered interesting locations.

Save X, Y and Z coordinates.

Add custom waypoint names.

Add waypoint colors.

Distance indicators.

Waypoint visibility toggles.

Export and import waypoint files.

10. SEED ANALYSIS

Features:

Allow the user to manually enter a known world seed.

Analyze legitimate world-generation information.

Provide ore-generation estimates where supported.

Display chunk coordinates.

Never claim to recover a hidden multiplayer seed.

11. PERFORMANCE

Minimize CPU and RAM usage.

Avoid unnecessary background threads.

Cache rendering data.

Avoid FPS drops.

Handle world changes safely.

Prevent crashes when changing dimensions.

Make every module independently toggleable.

12. CONFIGURATION

Save settings in:
config/donuthunter/

Include:

Module settings.

GUI preferences.

Waypoints.

Radar configuration.

Colors and rendering preferences.

13. FINAL DELIVERABLES

I want you to do the entire development process.

Do not just provide example code or tutorials.

You must:

Generate the entire project.

Implement all modules.

Create the GUI.

Create required assets.

Configure Fabric and Gradle.

Compile the project.

Fix compilation errors.

Test the mod where possible.

Produce a downloadable DonutHunter-1.0.0.jar.

Provide installation instructions.

If a feature cannot work because Minecraft or the server does not expose the required information, explain that limitation instead of pretending it works.

The final result should be a polished, stable, complete Minecraft client-side mod.
Kodari AI
KodariNov 8 at 7:24 pm 3
DonutHunter
A standalone Fabric client-side mod for Minecraft 1.21.11 featuring a dark purple ClickGUI with smooth animations, search bar, and category navigation. Includes Sound Radar detecting directional audio events, Base Detector scoring suspicious block clusters, Diamond and Ancient Debris ESP highlighting visible ores, Stash Finder analyzing storage concentrations, Chunk Finder displaying borders and explored areas, Coordinate Logger with waypoint import/export, and Seed Analysis for manual seed input. All modules are independently toggleable with automatic config saving to config/donuthunter/, optimized for minimal CPU and RAM usage with safe world-change handling.

Plan:

  1. Set up a Fabric 1.21.11 client-only project with persistent configuration and waypoint data.

  2. Implement independently toggleable radar, storage-cluster, ore/debris, chunk-border, waypoint, and seed-estimate modules using only client-visible data.

  3. Build the Right Shift owo-ui panel, HUD/world overlays, and document the multiplayer-information limits.

Created the standalone Fabric 1.21.11 client mod project, targeting Java 21. Right Shift opens a dark purple owo-ui panel with category navigation, search, toggles, sliders, a dropdown, and saved settings.

It includes a sound radar, visible-block diamond and ancient-debris HUD highlights, storage-cluster scoring, visited-chunk grid, waypoint management with import/export, and a manual seed-reference field. Settings and discoveries are stored under config/donuthunter/.

Limitations: Ore highlights are colored HUD entries with coordinates and distance, not 3D outlines. Scans use only block data already available to the client and do not bypass anti-xray. Storage clusters are suspicions—not proof of a player base—and the mod cannot identify block placement or reliably infer tunnels. The seed field stores a seed you provide; it does not generate seed-specific ore predictions or recover hidden multiplayer seeds.

To get the JAR in Kodari:

  1. Click Compile in the top bar, or on a phone tap ⋮ → Compile Project.

  2. Click Compile in the window.

  3. When it succeeds, click Download on the build or Download DonutHunter-1.0.0.jar in the chat.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
settings.gradle
Code
12 1,270
src/client/java/com/donuthunter/DonutHunterClient.java
package com.donuthunter;

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.fabricmc.fabric.api.client.rendering.v1.hud.HudElementRegistry;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.sound.SoundInstance;
import net.minecraft.client.util.Window;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;

import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Deque;
import java.util.List;
import java.util.Locale;

public final class DonutHunterClient implements ClientModInitializer {
    private record SoundPing(String id, double x, double y, double z, long timestamp) {
    }

    private static final KeyBinding.Category KEY_CATEGORY = KeyBinding.Category.create(Identifier.of("donuthunter", "main"));
    private static final KeyBinding OPEN_GUI = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.donuthunter.open", 344, KEY_CATEGORY));
    private static final Deque<SoundPing> SOUND_PINGS = new ArrayDeque<>();
    private static final Object SOUND_LOCK = new Object();
    private static final DateTimeFormatter TIME_FORMAT = DateTimeFormatter.ofPattern("HH:mm:ss", Locale.ROOT).withZone(ZoneId.systemDefault());
    private static ClientWorld activeWorld;

    @Override
    public void onInitializeClient() {
        HunterData.load();
        ClientTickEvents.END_CLIENT_TICK.register(DonutHunterClient::tick);
        HudElementRegistry.addLast(Identifier.of("donuthunter", "hud"), (context, tickCounter) -> renderHud(context));
    }

    private static void tick(MinecraftClient client) {
        if (client.world != activeWorld) {
            activeWorld = client.world;
            synchronized (SOUND_LOCK) {
                SOUND_PINGS.clear();
            }
        }

        if (OPEN_GUI.wasPressed() && client.currentScreen == null) {
            client.setScreen(new HunterScreen());
        }
        HunterScanner.tick(client);
        pruneSounds();
    }

    public static void recordSound(SoundInstance sound) {
        long now = System.currentTimeMillis();
        synchronized (SOUND_LOCK) {
            SOUND_PINGS.addFirst(new SoundPing(sound.getId().toString(), sound.getX(), sound.getY(), sound.getZ(), now));
            while (SOUND_PINGS.size() > 64) {
                SOUND_PINGS.removeLast();
            }
        }
    }

    private static List<SoundPing> recentSounds() {
        long cutoff = System.currentTimeMillis() - 30_000;
        synchronized (SOUND_LOCK) {
            SOUND_PINGS.removeIf(ping -> ping.timestamp() < cutoff);
            return List.copyOf(SOUND_PINGS);
        }
    }

    private static void pruneSounds() {
        recentSounds();
    }

    private static void renderHud(DrawContext context) {
        MinecraftClient client = MinecraftClient.getInstance();
        if (client.player == null || client.world == null) {
            return;
        }

        int x = 10;
        int y = 10;
        if (HunterData.enabled(HunterData.Feature.SOUND_RADAR)) {
            drawSoundRadar(context, client, x, y);
            y += HunterData.radarSize() + 38;
        }

        BlockPos playerPos = client.player.getBlockPos();
        int playerX = playerPos.getX();
        int playerY = playerPos.getY();
        int playerZ = playerPos.getZ();
        if (HunterData.enabled(HunterData.Feature.DIAMOND_ESP) || HunterData.enabled(HunterData.Feature.ANCIENT_DEBRIS_ESP)) {
            List<HunterScanner.BlockMarker> markers = HunterScanner.nearestMarkers(playerX, playerY, playerZ, 6, HunterData.renderRange());
            if (!markers.isEmpty()) {
                drawText(context, "VISIBLE ORE HIGHLIGHTS", x, y, 0xFFE1C8FF);
                y += 13;
                for (HunterScanner.BlockMarker marker : markers) {
                    String label = switch (marker.kind()) {
                        case "diamond" -> "Diamond";
                        case "deepslate_diamond" -> "Deepslate diamond";
                        default -> "Ancient debris";
                    };
                    double distance = distance(client.player.getX(), client.player.getY(), client.player.getZ(), marker.x(), marker.y(), marker.z());
                    drawText(context, String.format(Locale.ROOT, "%s  %d %d %d  %.0fm", label, marker.x(), marker.y(), marker.z(), distance), x, y, markerColor(marker.kind()));
                    y += 12;
                }
            }
        }

        if (HunterData.enabled(HunterData.Feature.BASE_DETECTOR) || HunterData.enabled(HunterData.Feature.STASH_FINDER)) {
            List<HunterData.Finding> findings = HunterData.findings().stream()
                    .sorted(Comparator.comparingDouble(finding -> distance(client.player.getX(), client.player.getY(), client.player.getZ(), finding.x(), finding.y(), finding.z())))
                    .limit(4)
                    .toList();
            if (!findings.isEmpty()) {
                drawText(context, "SUSPICIOUS VISIBLE CLUSTERS · NOT PROOF", x, y, 0xFFD5B3FF);
                y += 13;
                for (HunterData.Finding finding : findings) {
                    drawText(context, String.format(Locale.ROOT, "%s  %d %d %d  score %d", finding.type(), finding.x(), finding.y(), finding.z(), finding.score()), x, y, 0xFFC5B9D5);
                    y += 12;
                }
            }
        }

        if (HunterData.enabled(HunterData.Feature.CHUNK_FINDER)) {
            drawChunkGrid(context, playerX, playerZ, x, y + 4);
            y += 100;
        }

        if (HunterData.enabled(HunterData.Feature.COORDINATE_LOGGER)) {
            List<HunterData.Waypoint> waypoints = HunterData.waypoints().stream()
                    .filter(HunterData.Waypoint::visible)
                    .sorted(Comparator.comparingDouble(waypoint -> distance(client.player.getX(), client.player.getY(), client.player.getZ(), waypoint.x(), waypoint.y(), waypoint.z())))
                    .limit(5)
                    .toList();
            if (!waypoints.isEmpty()) {
                drawText(context, "WAYPOINTS", x, y, 0xFFE1C8FF);
                y += 13;
                for (HunterData.Waypoint waypoint : waypoints) {
                    double distance = distance(client.player.getX(), client.player.getY(), client.player.getZ(), waypoint.x(), waypoint.y(), waypoint.z());
                    drawText(context, String.format(Locale.ROOT, "%s  %d %d %d  %.0fm", waypoint.name(), waypoint.x(), waypoint.y(), waypoint.z(), distance), x, y, waypoint.color());
                    y += 12;
                }
            }
        }

        if (HunterData.enabled(HunterData.Feature.SEED_ANALYSIS) && !HunterData.knownSeed().isBlank()) {
            drawText(context, "Known seed saved for reference; no multiplayer seed recovery or seed-based block predictions.", x, y, 0xFFAFA3BC);
        }
    }

    private static void drawSoundRadar(DrawContext context, MinecraftClient client, int x, int y) {
        int size = HunterData.radarSize();
        int centerX = x + size / 2;
        int centerY = y + size / 2 + 5;
        int cell = Math.max(7, size / 10);
        int radius = Math.max(3, size / cell / 2 - 1);
        context.fill(x, y, x + size, y + size + 22, 0xD90A0710);
        context.fill(x, y, x + size, y + 1, 0xFF7C4BB0);
        context.fill(x, y + size + 21, x + size, y + size + 22, 0xFF7C4BB0);
        drawText(context, "SOUND RADAR  ·  " + HunterData.soundRange() + "m", x + 5, y + 4, 0xFFE5CEFF);

        for (int gz = -radius; gz <= radius; gz++) {
            for (int gx = -radius; gx <= radius; gx++) {
                int distanceSquared = gx * gx + gz * gz;
                if (distanceSquared > radius * radius) {
                    continue;
                }
                String glyph = distanceSquared == 0 ? "+" : distanceSquared >= (radius - 1) * (radius - 1) ? "·" : " ";
                if (!glyph.isBlank()) {
                    drawText(context, glyph, centerX + gx * cell, centerY + gz * cell, 0xFF776987);
                }
            }
        }

        double range = HunterData.soundRange();
        for (SoundPing ping : recentSounds()) {
            double dx = ping.x() - client.player.getX();
            double dz = ping.z() - client.player.getZ();
            double horizontalDistance = Math.sqrt(dx * dx + dz * dz);
            if (horizontalDistance > range) {
                continue;
            }
            int px = centerX + (int) Math.round(dx / range * radius * cell);
            int py = centerY + (int) Math.round(dz / range * radius * cell);
            String shortName = ping.id().substring(ping.id().indexOf(':') + 1);
            drawText(context, "•", px, py, ping.y() < 0 ? 0xFFFF52D6 : 0xFFFFC857);
            String age = TIME_FORMAT.format(Instant.ofEpochMilli(ping.timestamp()));
            String displayName = HunterData.detailedRadar() ? shortName : shortName.length() > 14 ? shortName.substring(0, 14) : shortName;
            drawText(context, displayName + "  " + age + "  ~" + Math.round(distance(client.player.getX(), client.player.getY(), client.player.getZ(), ping.x(), ping.y(), ping.z())) + "m", x + 5, y + size + 4 + (int) ((System.currentTimeMillis() - ping.timestamp()) / 1000) % 2 * 0, ping.y() < 0 ? 0xFFFF72DF : 0xFFCFC3D9);
        }
    }