VelocityReduce is an active knockback mitigation system based on the principles of spatiotemporal decoupling and motion state overriding. Its core idea is to convert the passive displacement imposed by the server into a sequence of client-controlled movements, thereby legitimizing the velocity reduction rather than simply brute-force canceling the velocity packet. 1. Event Filtering and Trigger Perception The module establishes a “valid knockback” event through dual-event correlation: it first captures a damage event and enters a waiting state; if a server-issued entity velocity packet follows immediately afterward, and the player is not engaged in actions unsuitable for intervention (such as scaffolding or using items), then the system recognizes a knockback that requires processing. This pairing mechanism effectively excludes false triggers from explosions, environmental displacement, and other non-damage sources. 2. Adaptive Decision Engine Once knockback is detected, the module enters a decision tree that selects a strategy based on two variables: · Target Lock Status: whether a nearby attackable entity exists (sourced from KillAura target, crosshair target, or nearest entity). · Player Motion State: whether the player is sprinting. The decision logic is grounded in kinematic differences: while sprinting, the player has higher horizontal speed, making it possible to overwrite the knockback component using the velocity reset mechanic of attacking; when not sprinting or lacking a target, forced attacks yield suboptimal results, necessitating a spatiotemporal buffer via asynchronous delay. Thus, two paths emerge: · Path A (Lag): no locked target OR not sprinting → activates the “time-freeze” mechanism. · Path B (Attack): target locked AND sprinting → immediately initiates the “attack offset” loop. 3. Lag Strategy: Spatiotemporal Displacement via Network Congestion The Lag strategy essentially simulates a brief client-server state decoupling: · Inbound Data Buffering: All server update packets are temporarily queued and not processed (simulating artificially high latency), freezing the client-side perspective. · Forced Client Displacement: During this period, forward movement input is injected toward the target on each game tick, causing the client-side position to continuously approach the target. · Exit Condition Arbitration: The system monitors multiple exit conditions—target within acceptable distance, timeout, exceeding the maximum range, receiving a forced server position correction (S08 flag), etc. Once satisfied, all buffered packets are released in one burst, performing a full state synchronization. At the moment of synchronization, because the client has moved further forward during the decoupled period, the original backward displacement from knockback is relatively offset, and the server finally observes a much smaller net displacement. This mechanism is essentially “borrowing movement in the time dimension and repaying it at synchronization,” thus avoiding the anti-cheat signatures of directly modifying velocity packets. After the Lag ends, the system automatically transitions into the Attack loop to solidify the final position. 4. Attack Strategy: Motion Vector Suppression and Offset The Attack path exploits the game mechanic that allows velocity to be overwritten when attacking an entity, executing a precise velocity control sequence: · Sprint State Removal: Sprinting is immediately disabled to lower base speed. · Continuous Attack Window: Over several game ticks, forced attacks are performed on the locked target without visible swing animation to avoid visual artifacts. On each attack tick, the client’s movement vector is scaled by horizontal and vertical coefficients (e.g., horizontal reduced to 0.6), while the vertical component is controlled independently. · Directional Vector Injection: On the same game tick, the movement input is forcibly replaced with a pure forward direction (toward the target) to artificially accelerate and counteract the residual backward momentum. · Randomized Iteration Count: The number of attacks is randomly chosen within a configured range, avoiding a fixed behavioral signature. This process redistributes the momentum originally imposed by the server through a series of legally valid attack actions, ultimately manifesting as the player staying nearly in place or moving only minimally. 5. Defensive Mechanisms and Anti-Detection Considerations The entire system incorporates multiple layers of safety valves: · Setback Event Monitoring: Upon detecting a forced server position correction (PlayerPositionPacket), the Lag strategy is immediately terminated to prevent prolonged desynchronization from triggering anti-cheat flags. · State Awareness and Self-Lock: If the player enters spectator mode, flight, or loses the KillAura target, the system promptly releases the delay and resets, preventing anomalous behavior. · External Conflict Avoidance: During scaffolding, item usage, and similar actions, intervention is automatically suspended to avoid unpredictable interactions with other modules. Conclusion VelocityReduce is fundamentally a hybrid “lag compensation – momentum override” system. By employing spatiotemporal separation to turn network latency into a tactical asset, and leveraging the legitimate velocity rewriting properties of combat states, it achieves a non-linear attenuation of knockback through multi-step micro-operations. The entire scheme deliberately avoids directly tampering with server communications, instead manipulating the client-side timeline and movement input, thereby delivering highly effective and difficult-to-detect knockback resistance. This idea comes from LiquidBounceNextGen. (github.com/CCBlueX/liquidbounce) code:/* * This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce) * * Copyright (c) 2015 - 2026 CCBlueX * * LiquidBounce is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * LiquidBounce is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with LiquidBounce. If not, see <https://www.gnu.org/licenses/>. */ package net.ccbluex.liquidbounce.features.module.modules.combat.velocity.mode import net.ccbluex.fastutil.filterIsInstance import net.ccbluex.fastutil.weightedMinByOrNullAtMost import net.ccbluex.liquidbounce.config.types.group.ToggleableValueGroup import net.ccbluex.liquidbounce.event.events.BlinkPacketEvent import net.ccbluex.liquidbounce.event.events.GameTickEvent import net.ccbluex.liquidbounce.event.events.MovementInputEvent import net.ccbluex.liquidbounce.event.events.NotificationEvent import net.ccbluex.liquidbounce.event.events.PacketEvent import net.ccbluex.liquidbounce.event.events.TickPacketProcessEvent import net.ccbluex.liquidbounce.event.events.TransferOrigin import net.ccbluex.liquidbounce.event.handler import net.ccbluex.liquidbounce.features.blink.BlinkManager import net.ccbluex.liquidbounce.features.blink.TrackedEntityPosition import net.ccbluex.liquidbounce.features.blink.esp.BlinkEspBox import net.ccbluex.liquidbounce.features.blink.esp.BlinkEspData import net.ccbluex.liquidbounce.features.blink.esp.BlinkEspModel import net.ccbluex.liquidbounce.features.blink.esp.BlinkEspNone import net.ccbluex.liquidbounce.features.blink.esp.BlinkEspWireframe import net.ccbluex.liquidbounce.features.module.modules.combat.killaura.ModuleKillAura import net.ccbluex.liquidbounce.features.module.modules.combat.velocity.ModuleVelocity import net.ccbluex.liquidbounce.features.module.modules.world.scaffold.ModuleScaffold import net.ccbluex.liquidbounce.utils.aiming.RotationManager import net.ccbluex.liquidbounce.utils.block.SwingMode import net.ccbluex.liquidbounce.utils.client.chat import net.ccbluex.liquidbounce.utils.client.notification import net.ccbluex.liquidbounce.utils.combat.attackEntity import net.ccbluex.liquidbounce.utils.combat.shouldBeAttacked import net.ccbluex.liquidbounce.utils.entity.rotation import net.ccbluex.liquidbounce.utils.entity.squaredBoxedDistanceTo import net.ccbluex.liquidbounce.utils.math.multiply import net.ccbluex.liquidbounce.utils.math.sq import net.ccbluex.liquidbounce.utils.movement.DirectionalInput import net.ccbluex.liquidbounce.utils.network.isLocalPlayerDamage import net.ccbluex.liquidbounce.utils.network.isLocalPlayerVelocity import net.ccbluex.liquidbounce.utils.raytracing.findEntityInCrosshair import net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket import net.minecraft.world.entity.Entity import net.minecraft.world.entity.LivingEntity import net.minecraft.world.phys.Vec3 /** * Attack Reduce */ object VelocityReduce : VelocityMode("Reduce") { private val attackCount by intRange("AttackCount", 3..3, 0..20) private val lagTargetRange by floatRange("LagTargetRange", 2f..6f, 0f..20f) private val lagMaxDelay by int("LagMaxDelay", 10, 1..1000, "ticks") private val lagRequireKillAura by boolean("LagRequireKillAura", false) private val horizontal by float("Horizontal", 0.6f, 0f..1f) private val vertical by float("Vertical", 1.0f, 0f..1f) private object Debug : ToggleableValueGroup(this, "Debug", false) { val chatMessage by boolean("ChatMessage", false) val notification by boolean("Notification", false) fun notify(message: String) { if (!this.enabled) { return } if (notification) { notification(ModuleVelocity.name, message, NotificationEvent.Severity.INFO) } if (chatMessage) { chat(message) } } } private val debug = tree(Debug).apply { doNotIncludeAlways() } private val espMode = modes("BlinkEsp", 2) { arrayOf( BlinkEspBox(it, ::getEspData), BlinkEspModel(it, getEspData = ::getEspData), BlinkEspWireframe(it, ::getEspData), BlinkEspNone(it), ) }.apply { doNotIncludeAlways() } private val canLag: Boolean get() = !lagRequireKillAura || ModuleKillAura.running private var target: Entity? = null private var renderTarget: Entity? = null private var renderTargetPos: TrackedEntityPosition? = null var remainingAttackCount = 0 private set private var currentGameTick = 0L private var forwardInputAttackGameTick = -1L private var receiveDamage = false private var lagTicks = -1 private var releaseReason: ReleaseReason? = null private enum class ReleaseReason(val debugSuffix: String?) { TARGET_REACHED(null), FLAG("flag"), SPECTATOR("spectator"), OUT_OF_RANGE("out of range"), MAX_DELAY("max delay"), } val backtrackBlocked: Boolean get() = lagTicks >= 0 || remainingAttackCount > 0 val ownsIncomingBlinkQueue: Boolean get() = lagTicks >= 0 private fun resetRenderState() { renderTarget = null renderTargetPos = null } override fun enable() { target = null resetRenderState() remainingAttackCount = 0 currentGameTick = 0L forwardInputAttackGameTick = -1L receiveDamage = false lagTicks = -1 releaseReason = null } override fun disable() { if (lagTicks >= 0) { BlinkManager.flush(TransferOrigin.INCOMING) } target = null resetRenderState() remainingAttackCount = 0 currentGameTick = 0L forwardInputAttackGameTick = -1L receiveDamage = false lagTicks = -1 releaseReason = null } private fun findTarget() { if (!canLag && lagTicks >= 0) return if (ModuleKillAura.running && ModuleKillAura.targetTracker.target != null) { if (lagTicks == -1) { renderTarget = ModuleKillAura.targetTracker.target } if (!canLag || ModuleKillAura.targetTracker.target!!.squaredBoxedDistanceTo(player) <= lagTargetRange.start.sq() ) { target = ModuleKillAura.targetTracker.target } return } target = findEntityInCrosshair( (if (canLag) { lagTargetRange.start.toDouble() } else { ModuleKillAura.range.interactionRange.toDouble() }), RotationManager.currentRotation ?: player.rotation ) { !it.isRemoved && it.shouldBeAttacked() }?.entity if (lagTicks == -1) { renderTarget = target } if (target != null || lagTicks >= 0) return renderTarget = world.entitiesForRendering().filterIsInstance<LivingEntity> { entity -> !entity.isRemoved && entity.shouldBeAttacked() }.weightedMinByOrNullAtMost(lagTargetRange.endInclusive.sq().toDouble()) { entity -> entity.squaredBoxedDistanceTo(player) } } private fun getEspData(): BlinkEspData? { if (lagTicks == -1) { return null } val renderTarget = renderTarget ?: return null val renderTargetPos = renderTargetPos ?: return null return BlinkEspData(renderTarget, renderTargetPos.base, renderTarget.rotation) } private fun hasLostReduceTarget(): Boolean { val reduceTarget = target ?: return true if (!ModuleKillAura.running) { return false } val killAuraTarget = ModuleKillAura.targetTracker.target ?: return true return killAuraTarget.id != reduceTarget.id } @Suppress("unused") private val packetEventHandler = handler<PacketEvent> { event -> if (event.origin != TransferOrigin.INCOMING) return@handler val packet = event.packet if (lagTicks >= 0) { if (packet is ClientboundPlayerPositionPacket) { releaseReason = ReleaseReason.FLAG } val trackedTargetPosition = renderTargetPos val trackedTarget = renderTarget if (trackedTargetPosition != null && trackedTarget != null) { trackedTargetPosition.handlePacket(packet, world, trackedTarget) } return@handler } if (ModuleVelocity.pause > 0) return@handler if (packet.isLocalPlayerDamage()) { receiveDamage = true } if (packet.isLocalPlayerVelocity() && receiveDamage) { receiveDamage = false if (player.isUsingItem || ModuleScaffold.running) return@handler findTarget() if (renderTarget == null) return@handler if ((target == null && canLag) || (target != null && !player.isSprinting)) { if (target != null) { debug.notify("Lag... (not sprinting)") } else { debug.notify("Lag...") } if (target == null) { renderTargetPos = TrackedEntityPosition(renderTarget!!) } lagTicks = lagMaxDelay } else if (target != null) { remainingAttackCount = attackCount.random() } } } @Suppress("unused") private val queuePacketHandler = handler<BlinkPacketEvent> { event -> if (lagTicks >= 0 && event.origin == TransferOrigin.INCOMING) { event.action = BlinkManager.Action.QUEUE } } @Suppress("unused") private val tickHandler = handler<GameTickEvent> { currentGameTick++ if (remainingAttackCount > 0) { if (hasLostReduceTarget()) { remainingAttackCount = 0 target = null return@handler } player.isSprinting = false attackEntity(target!!, SwingMode.DO_NOT_HIDE) forwardInputAttackGameTick = currentGameTick player.deltaMovement = player.deltaMovement.multiply(horizontal, vertical, horizontal) remainingAttackCount-- if (remainingAttackCount == 0) { target = null } } } @Suppress("unused") private val tickPacketProcessEventHandler = handler<TickPacketProcessEvent> { releaseReason?.let { releaseReason -> BlinkManager.flush(TransferOrigin.INCOMING) lagTicks = -1 resetRenderState() if (releaseReason == ReleaseReason.TARGET_REACHED) { debug.notify("Finish lag") remainingAttackCount = attackCount.random() } else { debug.notify("Finish lag (${releaseReason.debugSuffix})") } this.releaseReason = null } } @Suppress("unused") private val movementInputEventHandler = handler<MovementInputEvent> { event -> if (lagTicks > 0 && releaseReason == null) { lagTicks-- findTarget() when { player.abilities.flying -> releaseReason = ReleaseReason.SPECTATOR target != null -> { event.directionalInput = DirectionalInput.FORWARDS releaseReason = ReleaseReason.TARGET_REACHED } player.distanceToSqr(renderTargetPos?.base ?: Vec3.ZERO) > lagTargetRange.endInclusive.sq() -> { releaseReason = ReleaseReason.OUT_OF_RANGE } lagTicks == 0 -> releaseReason = ReleaseReason.MAX_DELAY } } if (currentGameTick == forwardInputAttackGameTick) { event.directionalInput = event.directionalInput.copy( forwards = true, backwards = false ) } } }