Mario 019

Create cheats for me version 1.21.4 Fabric

Kodari AI
KodariNov 15 at 10:33 pm 1
MinecraftCheatSuite
A Fabric mod for Minecraft 1.21.4 providing a comprehensive suite of client-side cheat features. Includes an in-game GUI menu with toggles for flight, speed, jump boost, no-clip, x-ray vision, auto-clicker, kill aura, and fullbright. Features customizable keybinds, a HUD displaying active cheats, and configurable settings for each module. Designed for single-player use with a clean, modular architecture supporting easy extension of new cheat modules.
  • Set up the Fabric 1.21.4 client-only project scaffold.

  • Add Fullbright and Auto Sprint toggles, bound to F6 and F7.

  • Restore the original gamma when Fullbright is disabled and localize both keybindings.

Created the client-only Fabric 1.21.4 CheatKeys mod.

  • F6: Toggle Fullbright; restores your previous gamma when turned off.

  • F7: Toggle Auto Sprint; sprints while moving forward when you have more than 6 food points.

  • Both keybindings can be changed in Minecraft’s Controls menu.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
6 142
src/main/java/dev/kodari/cheatkeys/CheatKeysClient.java
package dev.kodari.cheatkeys;

import net.fabricmc.api.ModInitializer;
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;

public final class CheatKeysClient implements ModInitializer {
    private static final double FULLBRIGHT_GAMMA = 1.0;

    private KeyBinding fullbrightKey;
    private KeyBinding autoSprintKey;
    private boolean fullbrightEnabled;
    private boolean autoSprintEnabled;
    private double previousGamma;

    @Override
    public void onInitialize() {
        fullbrightKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
                "key.cheatkeys.fullbright",
                InputUtil.fromTranslationKey("key.keyboard.f6").getCode(),
                "key.category.cheatkeys"
        ));
        autoSprintKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
                "key.cheatkeys.auto_sprint",
                InputUtil.fromTranslationKey("key.keyboard.f7").getCode(),
                "key.category.cheatkeys"
        ));

        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            if (fullbrightKey.wasPressed()) {
                if (fullbrightEnabled) {
                    fullbrightEnabled = false;
                    client.options.getGamma().setValue(previousGamma);
                } else {
                    previousGamma = client.options.getGamma().getValue();
                    fullbrightEnabled = true;
                }
            }

            if (autoSprintKey.wasPressed()) {
                autoSprintEnabled = !autoSprintEnabled;
                if (!autoSprintEnabled && client.player != null) {
                    client.player.setSprinting(false);
                }
            }

            if (fullbrightEnabled) {
                client.options.getGamma().setValue(FULLBRIGHT_GAMMA);
            }

            if (autoSprintEnabled && client.player != null) {
                boolean movingForward = client.options.forwardKey.isPressed();
                boolean enoughFood = client.player.getHungerManager().getFoodLevel() > 6;
                client.player.setSprinting(movingForward && enoughFood);
            }
        });
    }
}