Critical Hit Sprint Reset

Crit_Sprint_Reset Combat HIGH +9 score

🎮 Minecraft Gameplay Impact

In vanilla Minecraft combat, critical hits deliver +50% extra base damage and bonus spark particles, but the game engine strictly requires the attacker to be falling downwards (fallDistance > 0), not in water/lava, not climbing, and crucially: NOT sprinting. This combat module intercepts the attack action to momentarily clear the player's sprinting flag (setSprinting(false)) on the client tick before the attack packet is sent, allowing 100% guaranteed critical attacks while sprinting continuously forward at full sprint speed.

🔍 Functions & APIs Analyzed

ClientPlayerInteractionManager.attackEntity

Client interaction method (method_2918) invoked to attack a targeted entity and send PlayerInteractEntityC2SPacket to the server.

Entity.setSprinting

Modifies player sprinting state (method_5728) and sends PlayerCommandC2SPacket.Mode.STOP_SPRINTING.

ClientPlayerEntity.swingHand

Triggers client-side arm swinging animation (method_6104) and emits HandSwingC2SPacket.

💻 Mod Implementation (Dev Source / Mapped)

// Developer Source (Fabric / Yarn mappings)
public class AutoCrit {
    public static void performCriticalHit(MinecraftClient client, Entity target) {
        if (client.player == null || target == null) return;
        boolean wasSprinting = client.player.isSprinting();
        if (wasSprinting) {
            client.player.setSprinting(false);
        }
        client.interactionManager.attackEntity(client.player, target);
        client.player.swingHand(Hand.MAIN_HAND);
        if (wasSprinting) {
            client.player.setSprinting(true);
        }
    }
}

⚙️ Decompiled Representation (Vineflower View)

// Decompiled with Vineflower 1.12 (Intermediary mappings)
public class AutoCrit {
    public static void performCriticalHit(class_310 client, class_1297 target) {
        if (client.field_1724 != null && target != null) {
            boolean wasSprinting = client.field_1724.method_5624();
            if (wasSprinting) {
                client.field_1724.method_5728(false);
            }
            client.field_1761.method_2918(client.field_1724, target);
            client.field_1724.method_6104(class_1268.field_5808);
            if (wasSprinting) {
                client.field_1724.method_5728(true);
            }
        }
    }
}

🛡️ Bytecode Signature & Static Detection

Matches method references to net/minecraft/client/network/ClientPlayerInteractionManager.attackEntity (method_2918), net/minecraft/entity/Entity.setSprinting (method_5728), and ClientPlayerEntity.swingHand (method_6104) co-located within the same class.