kansies_

Create a Fabric 1.21.11 mod that automatically makes do a jump reset for you. Make it so that the player automatically jumps at the same tick the player gets hit and only when the playing is walking forward. On top of that, make it so that the bot will only jump 30% of the time and make it be able to turn on and off with the "\" key. On top of that, make it configurable to lag and server delay to make it effective in servers.

Kodari AI
KodariOct 13 at 12:55 pm 2
AutoJumpResetMod
Creates a Fabric 1.21.11 mod that automatically performs a jump reset when the player is hit while walking forward. The mod triggers a jump on the exact tick of impact, but only activates 30% of the time. It can be toggled on and off with the backslash key. The mod includes configurable settings for lag compensation and server delay to ensure effective timing on online servers, allowing players to optimize jump reset performance based on their connection.
  1. Add a Fabric 1.21.11 client mod with a \ toggle and a 30% jump-reset chance when a hit is detected while moving forward.

  2. Add editable lag/server-delay tick settings; default both to zero so jumps happen on the detected hit tick.

Created the Fabric 1.21.11 client mod. It starts enabled; press \ to toggle it. On a detected hit, it has a 30% chance to jump if you’re moving forward and grounded.

Timing settings are generated at config/jumpreset.properties. lag_compensation_ticks and server_delay_ticks are added together, each clamped to 0–40 ticks. Both default to 0, so the jump happens on the detected client tick. These settings adjust local timing; they don’t change network latency.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
7 219
src/client/java/com/kodari/jumpreset/JumpResetClient.java
package com.kodari.jumpreset;

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

import java.nio.file.Path;
import java.util.concurrent.ThreadLocalRandom;

public final class JumpResetClient implements ClientModInitializer {
    private static final double JUMP_CHANCE = 0.30;
    private static final KeyBinding.Category CATEGORY = KeyBinding.Category.create(Identifier.of("jumpreset", "main"));

    private KeyBinding toggleKey;
    private JumpResetConfig config;
    private ClientPlayerEntity trackedPlayer;
    private int previousHurtTime;
    private int pendingJumpDelay = -1;
    private boolean enabled = true;

    @Override
    public void onInitializeClient() {
        toggleKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
                "key.jumpreset.toggle",
                InputUtil.GLFW_KEY_BACKSLASH,
                CATEGORY
        ));
        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (toggleKey.wasPressed()) {
                enabled = !enabled;
                pendingJumpDelay = -1;
            }

            ClientPlayerEntity player = client.player;
            if (player == null) {
                trackedPlayer = null;
                previousHurtTime = 0;
                pendingJumpDelay = -1;
                return;
            }

            if (player != trackedPlayer) {
                trackedPlayer = player;
                previousHurtTime = player.hurtTime;
                pendingJumpDelay = -1;
            }

            int currentHurtTime = player.hurtTime;
            boolean wasHit = currentHurtTime > previousHurtTime;
            previousHurtTime = currentHurtTime;

            if (!enabled) {
                pendingJumpDelay = -1;
                return;
            }

            if (wasHit && player.input.hasForwardMovement() && ThreadLocalRandom.current().nextDouble() < JUMP_CHANCE) {
                pendingJumpDelay = config.lagCompensationTicks + config.serverDelayTicks;
            }

            if (pendingJumpDelay >= 0) {
                if (!player.input.hasForwardMovement() || !player.isOnGround()) {
                    pendingJumpDelay = -1;
                } else if (pendingJumpDelay == 0) {
                    player.jump();
                    pendingJumpDelay = -1;
                } else {
                    pendingJumpDelay--;
                }
            }
        });

        Path configFile = net.minecraft.client.MinecraftClient.getInstance().runDirectory.toPath()
                .resolve("config")
                .resolve("jumpreset.properties");
        config = JumpResetConfig.load(configFile);
    }
}