not_cvr

Act as an expert Minecraft Java Mod Developer. Create a complete Fabric Hitbox Adjustment Mod for Minecraft Java Edition 1.21.11, designed primarily for multiplayer servers that permit custom hitboxes.

Controls (use ONLY the number keys 8 and 9 on the keyboard's top number row):

  • 9 key: Open a GUI with sliders to increase or decrease hitbox width and height.
  • 8 key: Toggle hitbox adjustment ON/OFF.
  • Do not assign any other keys for these features.
  • Make the hitbox outline visible from the player's camera when enabled.
  • Ensure accurate melee hit detection when attacking with bare hands or any weapon, following the server's authorized combat mechanics.
  • Use configurable, conservative hitbox limits and restore vanilla behavior when disabled.
  • Support multiplayer environments where server-side permissions or compatible server support are available.
  • Never claim that the mod works on every server or guarantees ban protection. Do not bypass anti-cheat, spoof packets, or evade server restrictions.
  • Provide complete build-ready source code, Gradle configuration, Fabric metadata, and installation instructions for Minecraft Java Edition 1.21.11.

Important: Clearly distinguish visual hitbox resizing from actual server-recognized hitbox changes. Explain any server-side requirements and compatibility limitations.

Kodari AI
KodariOct 27 at 11:06 am 4
HitboxAdjuster
A Fabric mod for Minecraft 1.21.11 that lets players visually adjust their hitbox dimensions via a GUI opened with the 9 key, and toggle the adjustment with the 8 key. The mod renders a visible hitbox outline from the player's camera perspective and applies conservative, configurable size limits to maintain fair combat. It clearly separates client-side visual resizing from server-recognized hitbox changes, requiring compatible server-side support for actual hit detection modifications. When disabled, vanilla behavior is fully restored. The mod does not bypass anti-cheat or guarantee server acceptance, and includes complete build-ready source code with Gradle configuration and installation instructions.

Plan:

  1. Build a client-side visual hitbox adjustment mod with conservative sliders and the 8/9 controls.

  2. Keep vanilla/server-authorized melee targeting untouched; document that real hitbox changes require compatible server-side support.

  3. Add the Fabric project metadata, dependencies, source, and installation notes.

Created a client-only Fabric 1.21.11 mod with Gradle configuration, Fabric metadata, source code, and installation instructions in README.md.

  • Top-row 8 toggles the entity outline; top-row 9 opens width and height sliders, limited to 0.75×–1.50×.

  • The sliders adjust only the outline. Vanilla melee targeting and server combat validation remain unchanged. Real hitbox changes require compatible server-side support; this project does not implement that support or bypass server restrictions.

  • Install Fabric Loader and Fabric API for 1.21.11, plus YACL. Kodari’s bundled download includes the declared YACL dependency.

  • The selected keys may also trigger vanilla hotbar slots 8 and 9.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
README.md
settings.gradle
Code
11 389
src/client/java/com/kodari/hitboxvisualizer/HitboxVisualizerClient.java
package com.kodari.hitboxvisualizer;

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.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.util.Identifier;

public final class HitboxVisualizerClient implements ClientModInitializer {
    private static final String MOD_ID = "hitboxvisualizer";
    private static final KeyBinding.Category KEY_CATEGORY = KeyBinding.Category.create(
            Identifier.of(MOD_ID, "controls")
    );

    private static KeyBinding settingsKey;
    private static KeyBinding toggleKey;

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

        settingsKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
                "key.hitboxvisualizer.settings",
                InputUtil.GLFW_KEY_9,
                KEY_CATEGORY
        ));
        toggleKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
                "key.hitboxvisualizer.toggle",
                InputUtil.GLFW_KEY_8,
                KEY_CATEGORY
        ));

        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (settingsKey.wasPressed()) {
                if (client.player != null) {
                    client.setScreen(VisualSettingsScreen.create(null));
                }
            }

            while (toggleKey.wasPressed()) {
                VisualConfig.toggleEnabled();
                VisualConfig.save();
            }
        });

        HitboxOverlay.register();
    }
}