wergegreg
📎 1 file 6,368 chars
📄
pasted-code-1792757979862.txt
txt 66 lines
▶
You are building a Fabric client-side Minecraft PvP mod called "EdgeCore" (rename freely) for Minecraft Fabric 26.3. The focus is Sword PvP and Axe PvP. Before writing code, check the current Fabric Loader, Fabric API, Fabric Loom and Mod Menu versions that match 26.3, and use the mapping/naming setup that this version requires. Do not assume older 1.21.x APIs still work. Generate a complete, buildable project: gradle files, fabric.mod.json, mixins, entrypoints, assets and lang file.

## Hard rules
- Client-side only. No server component is required.
- Everything must be visual or informational. Do NOT add anything that automates or alters combat: no auto-clicker, triggerbot, aimbot, reach, velocity changes, auto-block, or packet manipulation. The player must perform every attack themselves.
- Keep performance cost minimal (no per-frame allocations in render hooks).
- Write clean, commented, modular code. Each feature is its own module class with an enabled flag and its own settings.

## Core systems
1. Module system: abstract Module class (name, description, category, enabled, settings list, onTick, onRender). A ModuleManager registers all modules.
2. Settings types: boolean, slider (int/float), enum/dropdown, color (with alpha), keybind.
3. Config: JSON file in the Fabric config directory. Auto-save on change, auto-load on start. Support multiple named profiles (e.g. "Sword", "Axe") that can be switched from the GUI.
4. Keybind: a configurable keybind (default Right Shift) opens the Click GUI. Register it through Fabric's keybinding API.
5. Mod Menu compatibility: implement ModMenuApi so the config button in Mod Menu opens the exact same Click GUI screen.

## Required features
1. **Sword Hit Timing Indicator**
   - Show when the next attack should be made for maximum damage without waiting for the full cooldown.
   - Read the player's attack-strength scale and show it as a crosshair-attached bar or ring. The colour moves from red to yellow to green.
   - Include a configurable "optimal hit threshold" slider (default around 90-95%). When the cooldown crosses it, the indicator flashes or pulses and optionally plays a soft sound.
   - Styles: crosshair ring, bar under the crosshair, or numeric percentage. Position, size and colours are all configurable.
   - Detect the held weapon (sword or axe) and use the correct cooldown for that item.

2. **Shield Status Indicator (own shield only)**
   - Draw an overlay or tint on the player's own shield in the HUD (hotbar slot and/or an on-screen shield icon): green when usable, red when disabled by an axe.
   - Show a countdown of the remaining disabled time when available.
   - This must NOT affect the opponent's shield rendering at all.
   - Optional sound cue when the shield becomes usable again.

3. **Custom Zoom**
   - Hold-to-zoom keybind (default C).
   - Scroll wheel adjusts zoom level while zooming; smooth interpolated FOV transition in and out.
   - Settings: default zoom level, smoothness, scroll sensitivity, optional cinematic camera, hide hand while zooming.
   - Must not interfere with normal FOV settings after release.

## Additional PvP features (implement these too)
4. **Axe Cooldown / Shield Break Timer** - an indicator specifically for axe swings, showing the longer axe cooldown and when a shield-disabling hit is ready.
5. **Target HUD** - when attacking a player, show their name, health bar, armour value, and held item. Fade out after a few seconds.
6. **Combo Counter** - counts consecutive hits on the same target without being hit back; resets on taking damage or after a timeout. Animated number with colour scaling.
7. **Critical Hit Indicator** - a small crosshair cue when conditions for a critical hit are met (falling, not sprinting, not on ground, cooldown ready).
8. **Hit Feedback** - configurable red/colour overlay on the target on hit (client-side visual only) and optional hit sound.
9. **CPS Counter and Keystrokes** - movement keys plus left/right click display.
10. **Armour and Durability HUD** - shows armour pieces, held weapon and shield durability, with low-durability warnings.
11. **Totem Pop Counter and Offhand Display** - tracks totems used by the player and nearby enemies, shows the offhand item and count.
12. **Low Health Warning** - screen-edge vignette and/or sound when health falls below a threshold.
13. **Potion Effect HUD** - compact list with icons and timers (strength, speed, resistance, etc.).
14. **HUD Editor** - inside the GUI, a mode where every HUD element can be dragged, scaled and snapped to screen edges.

## Click GUI design
- Opens with the keybind or from Mod Menu. Game keeps rendering behind it with a subtle dark blur and background dim.
- Layout: a floating, centred window with rounded corners (about 8px radius), a dark charcoal theme (#14141A background, #1E1E28 panels) and one accent colour (default electric blue #4C8DFF) that the player can change.
- Left sidebar with category tabs and icons: Combat, Visuals, HUD, Utility, Settings/Profiles.
- Main area: a grid of module cards. Each card shows the name, a short description, and a toggle switch. Enabled cards get an accent-coloured left border or glow.
- Left-click a card to toggle it. Right-click (or click the arrow) to expand its settings inline: sliders with value labels, dropdowns, colour pickers with alpha, keybind buttons.
- Top bar with a search field that filters modules live, plus a profile selector dropdown.
- Smooth animations: fade and scale on open/close (~150ms), eased toggle switch movement, hover highlights.
- Scrollable content with a slim scrollbar. A tooltip appears on hover with the module's description.
- Bottom bar shows the keybind hint and a "Reset to default" button per module.
- Fully usable with mouse; Escape closes it. Respect the game's GUI scale.

## Deliverables
- Full source tree with package structure (core, modules, gui, config, mixin, util).
- All mixins listed in the mixins JSON, with a short comment explaining why each exists.
- Placeholder textures and a lang file.
- A README covering building (./gradlew build), installing, keybinds, and how to add a new module.
- If any API, class or mapping name is uncertain for 26.3, say so explicitly and verify it against current documentation instead of guessing.
Kodari AI
KodariOct 23 at 12:51 pm 15
EdgeCorePvP
Client-side Fabric PvP enhancement mod for Minecraft 26.3 focusing on visual and informational aids for sword and axe combat. Features a modular system with configurable settings, multiple profiles, and a Click GUI. Includes sword hit timing indicator, shield status display, custom zoom, axe cooldown timer, target HUD, combo counter, critical hit indicator, hit feedback, CPS counter, armour durability HUD, totem counter, low health warning, potion effect display, and a drag-and-drop HUD editor. All features are purely visual with no combat automation.
  1. Set up the 26.3 client-only Fabric project and verified version/dependency metadata.

  2. Build a modular, visual-only client core with persisted settings/profiles and PvP HUD indicators.

  3. Add the owo-ui click GUI, keybinds, zoom controls, and Mod Menu entrypoint.

  4. Add resources, mixin wiring only where needed, and a README.

Created the EdgeCore client-only Fabric 26.3 project with Gradle files, resources, README, owo-ui Click GUI, Mod Menu integration, configurable modules, JSON profiles, and a draggable/scalable HUD editor.

It uses Fabric Loader 0.19.5, Fabric API 0.161.0+26.3, Loom 1.17, Java 25, owo-lib 0.13.1, and Mod Menu 21.0.0. The HUD covers sword/axe timing, own-shield status, zoom, target/combo indicators, keystrokes and CPS, durability, totem pops, health warnings, and potion timers. Its mixins use the verified 26.3 method descriptors. Combat remains manual; the mod does not alter attacks or send combat packets.

Two visual details are limited by the available client data: shield status shows cooldown recovery rather than an exact seconds countdown, and hit feedback flashes the screen edges and target HUD rather than tinting the world entity.

To get the jar: click Compile in the desktop top bar (or ⋮ → Compile Project on phone), click Compile in the window, then click Download after it succeeds.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
README.md
settings.gradle
Code
27 2,037
src/client/java/dev/edgecore/EdgeCoreClient.java
package dev.edgecore;

import com.mojang.blaze3d.platform.InputConstants;
import dev.edgecore.core.EdgeCoreConfig;
import dev.edgecore.core.ModuleManager;
import dev.edgecore.core.RuntimeState;
import dev.edgecore.core.ZoomController;
import dev.edgecore.gui.EdgeCoreScreen;
import dev.edgecore.hud.HudRenderer;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.event.client.player.ClientPreAttackCallback;
import net.fabricmc.fabric.api.client.keymapping.v1.KeyMappingHelper;
import net.fabricmc.fabric.api.client.rendering.v1.hud.HudElementRegistry;
import net.fabricmc.fabric.api.event.player.AttackEntityCallback;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.Identifier;
import net.minecraft.world.InteractionResult;

public final class EdgeCoreClient implements ClientModInitializer {
    public static final String MOD_ID = "edgecore";
    public static final ModuleManager MODULES = new ModuleManager();
    public static KeyMapping GUI_KEY;
    public static KeyMapping ZOOM_KEY;

    public static void refreshKeyMappings() {
        if (GUI_KEY == null || ZOOM_KEY == null) {
            return;
        }
        GUI_KEY.setKey(InputConstants.Type.KEYBOARD.getOrCreate(MODULES.controls.guiKey.value()));
        ZOOM_KEY.setKey(InputConstants.Type.KEYBOARD.getOrCreate(MODULES.controls.zoomKey.value()));
        KeyMapping.resetMapping();
    }

    @Override
    public void onInitializeClient() {
        EdgeCoreConfig.load();
        FeatureKeySettings keySettings = new FeatureKeySettings();
        GUI_KEY = KeyMappingHelper.registerKeyMapping(new KeyMapping("key.edgecore.open_gui", keySettings.guiCode(), KeyMapping.Category.MISC));
        ZOOM_KEY = KeyMappingHelper.registerKeyMapping(new KeyMapping("key.edgecore.zoom", keySettings.zoomCode(), KeyMapping.Category.MISC));

        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (GUI_KEY.consumeClick()) {
                client.gui.setScreen(new EdgeCoreScreen(client.gui.screen()));
            }
            RuntimeState.tick(client);
            MODULES.tick(client);
            ZoomController.tick(MODULES.customZoom.enabled() && ZOOM_KEY.isDown());
        });

        ClientPreAttackCallback.EVENT.register((client, player, clickCount) -> {
            RuntimeState.recordClick();
            return false;
        });

        AttackEntityCallback.EVENT.register((player, level, hand, entity, hitResult) -> {
            if (player == Minecraft.getInstance().player) {
                RuntimeState.recordAttack(entity);
            }
            return InteractionResult.PASS;
        });

        HudElementRegistry.addLast(Identifier.fromNamespaceAndPath(MOD_ID, "pvp_hud"), HudRenderer::render);
    }

    private static final class FeatureKeySettings {
        private int guiCode() {
            return MODULES.controls.guiKey.value();
        }

        private int zoomCode() {
            return MODULES.controls.zoomKey.value();
        }
    }
}