_5h444_

Make one click per 2 cps like human reaction, not instant 2 cps at once. I want it goes like 1 cps, then 2 cps like super duper quick after one click instead of skipping 1 to 2cps at once.

the mod must works only when im off any GUI/Menu screen, Chest inventory, player's inventory, etc... Make sure i can break the block normally without issue despite it's double click.

make sure the mod is always on. No toggle or gui needed. 1.21.11 Fabric

Kodari AI
KodariOct 5 at 3:56 pm 2
AdaptiveDoubleClick
An automatic double-click enhancement for Minecraft that intelligently triggers a second click shortly after your first click, but only when you're not interacting with any GUI or menu screen. The mod detects when you're in the game world and automatically performs a quick second click after your initial click, helping with actions like breaking blocks faster. It works seamlessly with normal gameplay, ensuring block breaking works normally without interference. The mod is always active with no toggle or configuration needed, and it's designed for Minecraft 1.21.11 on Fabric. The double-click timing is adaptive, starting with a single click then quickly following up with the second click for natural-feeling interaction.
  • Add a client-only Fabric mod targeting Minecraft 1.21.11, always enabled with no menu or toggle.

  • Schedule one follow-up attack about 100 ms after a successful click, only while no screen is open.

  • Skip block targets so normal block breaking is left untouched.

Added the always-on Fabric 1.21.11 client mod. A successful in-world attack gets one follow-up about 100 ms later; it does nothing while a screen is open. Block targets are skipped, so normal block breaking is unchanged.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
6 143
src/main/java/com/kodari/doubleclick/mixin/MinecraftClientMixin.java
package com.kodari.doubleclick.mixin;

import net.minecraft.client.MinecraftClient;
import net.minecraft.util.hit.BlockHitResult;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.gen.Invoker;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(MinecraftClient.class)
public abstract class MinecraftClientMixin {
    @Shadow
    private int attackCooldown;

    @Unique
    private int doubleclick$delay = -1;

    @Unique
    private boolean doubleclick$syntheticAttack;

    @Invoker("doAttack")
    protected abstract boolean doubleclick$doAttack();

    @Inject(method = "doAttack", at = @At("TAIL"))
    private void doubleclick$afterAttack(CallbackInfoReturnable<Boolean> callback) {
        if (doubleclick$syntheticAttack || !callback.getReturnValue()) {
            return;
        }

        MinecraftClient client = (MinecraftClient) (Object) this;
        if (client.currentScreen != null || client.player == null || client.world == null
                || client.crosshairTarget instanceof BlockHitResult) {
            return;
        }

        doubleclick$delay = 3;
    }

    @Inject(method = "tick", at = @At("TAIL"))
    private void doubleclick$tick(CallbackInfo callback) {
        if (doubleclick$delay < 0 || --doubleclick$delay > 0) {
            return;
        }

        MinecraftClient client = (MinecraftClient) (Object) this;
        if (client.currentScreen != null || client.player == null || client.world == null
                || client.crosshairTarget instanceof BlockHitResult) {
            doubleclick$delay = -1;
            return;
        }

        doubleclick$delay = -1;
        doubleclick$syntheticAttack = true;
        attackCooldown = 0;
        try {
            doubleclick$doAttack();
        } finally {
            doubleclick$syntheticAttack = false;
        }
    }
}