Task fromhallo

Implement the requested Fabric client utility mod in this project, targeting Minecraft Java 1.21.11 and using the project's existing Fabric setup and mappings. Mod name/branding: Piggyhacks. Add the Java implementation, required mixins/render hooks, and fabric.mod.json metadata/configuration. Features: (1) Right Shift (GLFW_KEY_RIGHT_SHIFT) opens/closes an in-game ClickGUI. The GUI must expose module toggles and be usable with mouse/keyboard. (2) Freecam module: in singleplayer only, detach the render camera from the stationary player and allow free flight, including looking through blocks; preserve the player's real position and state while active, and restore camera cleanly when disabled or the world unloads. (3) Storage & Entity ESP module: in singleplayer only, draw colored bounding-box outlines through walls around storage chests and entities, including hostile mobs and players, with depth testing disabled only around the ESP rendering and restored afterward. (4) Show Piggyhacks branding on the HUD and in the main menu. (5) Persist module settings in config/piggyhacks.properties, loading defaults safely if absent and saving changes. Keep implementation compatible with Minecraft 1.21.11 APIs and this project's existing mappings/dependencies. Register all needed mixins and client entrypoints correctly. Do not add tests. Finish by summarizing files/features changed; do not claim to have built or verified compilation.

Kodari AI
KodariOct 23 at 4:16 pm 7
PiggyhacksUtilityMod
Piggyhacks is a Fabric client utility mod for Minecraft 1.21.11, offering an in-game ClickGUI toggled by Right Shift. Features include Freecam for singleplayer camera detachment with free flight, Storage & Entity ESP rendering colored bounding boxes through walls, HUD and main menu branding, and persistent settings stored in config/piggyhacks.properties. The mod integrates mixins for render hooks, depth testing control, and clean camera restoration, ensuring compatibility with the project's existing Fabric setup and mappings.
  1. Create the Fabric project scaffold and client entrypoint.

  2. Add the owo ClickGUI and persisted module settings.

  3. Implement singleplayer freecam with safe restoration.

  4. Add singleplayer ESP and Piggyhacks HUD/menu branding.

Implemented the Piggyhacks Fabric client mod scaffold and requested features.

  • Added Minecraft 1.21.11/Yarn Gradle setup, client metadata, mixin configuration, and owo-lib manifest entry.

  • Right Shift opens or closes an owo ClickGUI with Freecam, Storage ESP, and Entity ESP toggles.

  • Freecam is singleplayer-only: it detaches the camera, redirects mouse look, and holds the player in place on both client and integrated-server ticks. Disabling it or unloading the world restores the camera and saved player state.

  • Added through-wall outlines for chest variants, hostile mobs, and other players. The no-depth-test pipeline is scoped to the ESP render layer.

  • Added Piggyhacks branding to the HUD and title screen.

  • Module settings load with safe defaults and save to config/piggyhacks.properties when changed.

No tests were added. I did not build or verify compilation.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
settings.gradle
Code
16 733
src/client/java/dev/piggyhacks/PiggyhacksClient.java
package dev.piggyhacks;

import dev.piggyhacks.client.Freecam;
import dev.piggyhacks.client.gui.ClickGuiScreen;
import dev.piggyhacks.config.PiggyhacksConfig;
import io.wispforest.owo.ui.component.LabelComponent;
import io.wispforest.owo.ui.component.UIComponents;
import io.wispforest.owo.ui.container.FlowLayout;
import io.wispforest.owo.ui.container.UIContainers;
import io.wispforest.owo.ui.core.Color;
import io.wispforest.owo.ui.core.Positioning;
import io.wispforest.owo.ui.core.Sizing;
import io.wispforest.owo.ui.layers.Layers;
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.event.lifecycle.v1.ServerTickEvents;
import net.fabricmc.fabric.api.client.rendering.v1.hud.HudElementRegistry;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.TitleScreen;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;

public final class PiggyhacksClient implements ClientModInitializer {
    public static final String MOD_ID = "piggyhacks";
    private static final Text BRAND = Text.literal("Piggyhacks");
    private static KeyBinding clickGuiKey;

    @Override
    public void onInitializeClient() {
        PiggyhacksConfig.load();
        clickGuiKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
                "key.piggyhacks.clickgui",
                GLFW.GLFW_KEY_RIGHT_SHIFT,
                KeyBinding.Category.create(Identifier.of(MOD_ID, "main"))
        ));

        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (clickGuiKey.wasPressed()) {
                if (client.currentScreen instanceof ClickGuiScreen) {
                    client.setScreen(null);
                } else if (client.currentScreen == null) {
                    client.setScreen(new ClickGuiScreen());
                }
            }
            Freecam.tick(client);
        });
        ServerTickEvents.END_SERVER_TICK.register(Freecam::serverTick);

        registerHudBranding();
        registerTitleBranding();
    }

    public static void setFreecamEnabled(boolean enabled) {
        PiggyhacksConfig.setFreecamEnabled(enabled);
    }

    public static void setStorageEspEnabled(boolean enabled) {
        PiggyhacksConfig.setStorageEspEnabled(enabled);
    }

    public static void setEntityEspEnabled(boolean enabled) {
        PiggyhacksConfig.setEntityEspEnabled(enabled);
    }

    private static void registerHudBranding() {
        HudElementRegistry.addLast(Identifier.of(MOD_ID, "branding"), (drawContext, tickCounter) -> {
            MinecraftClient client = MinecraftClient.getInstance();
            drawContext.drawTextWithShadow(client.textRenderer, BRAND, 6, 6, 0xFFFF70C8);
        });
    }

    private static void registerTitleBranding() {
        Layers.add(UIContainers::verticalFlow, instance -> {
            FlowLayout root = instance.adapter.rootComponent;
            LabelComponent label = UIComponents.label(BRAND);
            label.color(Color.ofRgb(0xFF70C8));
            label.shadow(true);
            label.positioning(Positioning.absolute(8, 8));
            root.child(label);
        }, TitleScreen.class);
    }
}