err0r
📎 1 file 1,625 chars
📄
pasted-code-1794026546781.txt
txt 101 lines
▶
Create a Minecraft Java client-side Fabric mod called APPLE CLIENT.

Project configuration:

Minecraft Java: 26.3

Mod loader: Fabric

Language: Java

Mod ID: appleclient

Package: com.appleuis.appleclient

DESIGN:
Create a beautiful custom Click GUI with an Appleuis theme:

Dark charcoal background

Apple-green accents

Rounded buttons and panels

Smooth opening and closing animations

Custom APPLE CLIENT logo

Right Shift opens and closes the GUI

Organized module categories

MODULE CATEGORIES AND FEATURES:

COMBAT

Attack settings for single-player and private testing environments.

Configurable module toggles.

MOVEMENT

Toggle Sprint

Toggle Sneak

Movement convenience settings

RENDER

Fullbright

Entity highlighting

Custom visual settings

WORLD

Coordinates display

Waypoints

Direction indicator

HUD

FPS counter

CPS counter

Coordinates display

Customizable HUD positions

Toggleable HUD elements

MISC

Module configuration

GUI customization

Client settings

TECHNICAL REQUIREMENTS:


Make everything client-side wherever possible.

Use proper Java classes and clean project organization.

Make all GUI buttons and toggles functional.

Save settings between game sessions.

Avoid crashes and conflicting keybinds.

Include all required dependencies and Gradle configuration.

Make sure the project successfully builds into a working AppleClient.jar.

IMPORTANT: Do not just create a visual mockup. Implement the actual working mod and compile it into a downloadable JAR file compatible with Fabric
Kodari AI
KodariNov 7 at 4:56 am 5
AppleClientMod
AppleClient is a client-side Fabric mod for Minecraft 26.3 featuring a custom Appleuis-themed Click GUI with dark charcoal backgrounds, apple-green accents, and rounded panels. Press Right Shift to open the animated GUI with smooth transitions. Includes organized module categories: Combat with attack settings, Movement with toggle sprint and sneak, Render with fullbright and entity highlighting, World with coordinates and waypoints, HUD with FPS/CPS counters and customizable positions, and Misc for configuration. All modules are functional toggles with persistent settings saved between sessions via config files. Built with clean Java architecture, proper Gradle configuration, and Fabric API dependencies, producing a working AppleClient.jar compatible with Fabric loader.
  1. Set up the Fabric 26.3 project and client entry point.

  2. Build an owo-ui Apple-themed click GUI with persistent module settings and Right Shift toggle.

  3. Implement the client-side movement, visual, world, and HUD features.

Implemented APPLE CLIENT as a client-side Fabric 26.3 mod, with the Apple-green owo-ui GUI, Right Shift toggle, saved settings, movement toggles, maximum-brightness mode, entity highlights, waypoints, and configurable HUD counters and position. The Combat category provides a vanilla attack cooldown meter; it does not automate attacks.

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

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
settings.gradle
Code
12 752
src/client/java/com/appleuis/appleclient/AppleClientClient.java
package com.appleuis.appleclient;

import com.mojang.blaze3d.platform.InputConstants;
import com.mojang.blaze3d.platform.Window;
import net.fabricmc.api.ClientModInitializer;
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.hud.HudElementRegistry;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphicsExtractor;
import net.minecraft.client.input.MouseButtonInfo;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.resources.Identifier;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.phys.Vec3;

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.IdentityHashMap;
import java.util.List;
import java.util.Map;

public final class AppleClientClient implements ClientModInitializer {

    private static final Deque<Long> LEFT_CLICKS = new ArrayDeque<>();
    private static final Map<Entity, Boolean> PREVIOUS_GLOWING = new IdentityHashMap<>();
    private static KeyMapping openGuiKey;
    private static double previousGamma;
    private static boolean gammaCaptured;

    @Override
    public void onInitializeClient() {
        AppleClientConfig.load();

        KeyMapping.Category category = KeyMapping.Category.register(Identifier.fromNamespaceAndPath("appleclient", "general"));
        openGuiKey = KeyMappingHelper.registerKeyMapping(
                new KeyMapping("key.appleclient.open_gui", InputConstants.KEY_RSHIFT, category)
        );

        ClientTickEvents.END_CLIENT_TICK.register(AppleClientClient::tick);
        HudElementRegistry.addLast(
                Identifier.fromNamespaceAndPath("appleclient", "client_hud"),
                AppleClientClient::renderHud
        );
    }

    public static void recordMouseClick(int button, int action) {
        if (button != InputConstants.MOUSE_BUTTON_LEFT || action != InputConstants.PRESS) {
            return;
        }

        long now = System.currentTimeMillis();
        LEFT_CLICKS.addLast(now);
        trimClicks(now);
    }

    private static void tick(Minecraft client) {
        while (openGuiKey.consumeClick()) {
            if (client.gui.screen() instanceof AppleClientScreen screen) {
                screen.closeAnimated();
            } else {
                client.gui.setScreen(new AppleClientScreen());
            }
        }

        updateFullbright(client);

        Player player = client.player;
        ClientLevel level = client.level;
        if (player == null || level == null) {
            restoreEntityHighlights();
            return;
        }

        player.setSprinting(AppleClientConfig.toggleSprint || client.options.keySprint.isDown());
        player.setShiftKeyDown(AppleClientConfig.toggleSneak || client.options.keyShift.isDown());
        updateEntityHighlights(player, level);
    }

    private static void updateFullbright(Minecraft client) {
        if (AppleClientConfig.fullbright) {
            if (!gammaCaptured) {
                previousGamma = client.options.gamma().get();
                gammaCaptured = true;
            }
            if (client.options.gamma().get() < 1.0) {
                client.options.gamma().set(1.0);
            }
        } else if (gammaCaptured) {
            client.options.gamma().set(previousGamma);
            gammaCaptured = false;
        }
    }

    private static void updateEntityHighlights(Player player, ClientLevel level) {
        if (!AppleClientConfig.entityHighlight) {
            restoreEntityHighlights();
            return;
        }

        for (Entity entity : level.entitiesForRendering()) {
            if (entity == player || player.distanceToSqr(entity) > 48.0 * 48.0) {
                continue;
            }

            PREVIOUS_GLOWING.putIfAbsent(entity, entity.isCurrentlyGlowing());
            entity.setGlowingTag(true);
        }
    }

    private static void restoreEntityHighlights() {
        for (Map.Entry<Entity, Boolean> entry : PREVIOUS_GLOWING.entrySet()) {
            entry.getKey().setGlowingTag(entry.getValue());
        }
        PREVIOUS_GLOWING.clear();
    }

    private static void renderHud(GuiGraphicsExtractor graphics, net.minecraft.client.DeltaTracker deltaTracker) {
        Minecraft client = Minecraft.getInstance();
        Player player = client.player;
        if (player == null) {
            return;
        }

        List<String> lines = new ArrayList<>();
        if (AppleClientConfig.showFps) {
            lines.add("FPS  " + client.getFps());
        }
        if (AppleClientConfig.showCps) {
            lines.add("CPS  " + currentCps());
        }
        if (AppleClientConfig.showAttackMeter) {
            lines.add("ATTACK  " + Math.round(player.getAttackStrengthScale(0.0F) * 100.0F) + "%");
        }
        if (AppleClientConfig.showCoordinates) {
            Vec3 position = player.position();
            lines.add("XYZ  " + (int) Math.floor(position.x) + "  " + (int) Math.floor(position.y) + "  " + (int) Math.floor(position.z));
        }
        if (AppleClientConfig.showDirection) {
            lines.add("FACING  " + direction(player.getYRot()));
        }
        if (lines.isEmpty()) {
            return;
        }

        int maxWidth = lines.stream().mapToInt(client.font::width).max().orElse(0);
        Window window = client.getWindow();
        boolean right = AppleClientConfig.hudCorner == 1 || AppleClientConfig.hudCorner == 3;
        boolean bottom = AppleClientConfig.hudCorner >= 2;
        int x = right ? window.getGuiScaledWidth() - maxWidth - 8 : 8;
        int y = bottom ? window.getGuiScaledHeight() - lines.size() * 10 - 8 : 8;
        int color = 0xFF000000 | AppleClientConfig.accent;

        for (int index = 0; index < lines.size(); index++) {
            graphics.text(client.font, lines.get(index), x, y + index * 10, color, true);
        }
    }

    private static int currentCps() {
        long now = System.currentTimeMillis();
        trimClicks(now);
        return LEFT_CLICKS.size();
    }

    private static void trimClicks(long now) {
        while (!LEFT_CLICKS.isEmpty() && now - LEFT_CLICKS.peekFirst() > 1000L) {
            LEFT_CLICKS.removeFirst();
        }
    }

    private static String direction(float yaw) {
        return switch (Math.floorMod(Math.round(yaw / 90.0F), 4)) {
            case 0 -> "South";
            case 1 -> "West";
            case 2 -> "North";
            default -> "East";
        };
    }
}