Freeze module

Freeze: Minecraft 26.3 cheat module, full source for every implementation (3 clients: MelaHack (ThunderHack fork), Combatant, LiquidBounce (Kotlin)).

3 implementationsMOVEMENT

Full module source: 3 implementations

Every implementation below is the complete module file, verbatim. Expand a client to read its code.

MelaHack (ThunderHack fork)MOVEMENTsrc/main/java/thunder/hack/features/modules/movement/Freeze.javaJava · 34 lines · 817 B
Freeze.javaJava · Minecraft 26.2 · 34 lines · 817 B · complete file, verbatimOriginal ↗
1
package thunder.hack.features.modules.movement;
2
3
import meteordevelopment.orbit.EventHandler;
4
import meteordevelopment.orbit.EventPriority;
5
import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket;
6
import thunder.hack.events.impl.EventMove;
7
import thunder.hack.events.impl.PacketEvent;
8
import thunder.hack.features.modules.Module;
9
10
public class Freeze extends Module {
11
12
    public Freeze() {
13
        super("Freeze", Category.MOVEMENT);
14
    }
15
16
    @EventHandler(priority = EventPriority.LOW)
17
    public void onMove(EventMove e) {
18
19
            e.setX(0.);
20
            e.setY(0.);
21
            e.setZ(0.);
22
            e.cancel();
23
24
    }
25
26
    @EventHandler
27
    public void onPacketSend(PacketEvent.Send e) {
28
        if (e.getPacket() instanceof ServerboundMovePlayerPacket)
29
            e.cancel();
30
31
    }
32
33
}
34
CombatantMOVEMENTsrc/main/java/combatant/client/features/module/modules/movement/Freeze.javaJava · 26 lines · 616 B
Freeze.javaJava · Minecraft 26.2 · 26 lines · 616 B · complete file, verbatimOriginal ↗
1
/*
2
 * This file is part of the Combatant Client distribution.
3
 * Copyright (c) 2026 pivosos2007.
4
 *
5
 * Licensed under the GNU General Public License v3.0.
6
 */
7
8
package combatant.client.features.module.modules.movement;
9
10
import combatant.client.features.module.Module;
11
import combatant.client.features.module.ModuleCategory;
12
import combatant.client.features.module.ModuleInfo;
13
14
//todo Description
15
@ModuleInfo(
16
        id = "freeze",
17
        displayName = "Freeze",
18
        category = ModuleCategory.MOVEMENT
19
)
20
public final class Freeze extends Module {
21
22
    public Freeze() {
23
        setDefaultBind("COMMA");
24
    }
25
}
26
LiquidBounce (Kotlin)MOVEMENTsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/movement/ModuleFreeze.ktKotlin · 353 lines · 12.6 KB

Allows you to freeze yourself in your current position without the server knowing.

SettingsDisableOnNotificationBalanceWarpOriginCancelC0BInterval
ModuleFreeze.ktKotlin · Minecraft 26.2 · 353 lines · 12.6 KB · complete file, verbatimOriginal ↗
1
/*
2
 * This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
3
 *
4
 * Copyright (c) 2015 - 2026 CCBlueX
5
 *
6
 * LiquidBounce is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * LiquidBounce is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with LiquidBounce. If not, see <https://www.gnu.org/licenses/>.
18
 */
19
package net.ccbluex.liquidbounce.features.module.modules.movement
20
21
import net.ccbluex.fastutil.enumSetOf
22
import net.ccbluex.liquidbounce.config.types.group.Mode
23
import net.ccbluex.liquidbounce.config.types.group.ModeValueGroup
24
import net.ccbluex.liquidbounce.config.types.list.Tagged
25
import net.ccbluex.liquidbounce.event.events.BlinkPacketEvent
26
import net.ccbluex.liquidbounce.event.events.GameTickEvent
27
import net.ccbluex.liquidbounce.event.events.NotificationEvent
28
import net.ccbluex.liquidbounce.event.events.PacketEvent
29
import net.ccbluex.liquidbounce.event.events.PlayerMovementTickEvent
30
import net.ccbluex.liquidbounce.event.events.PlayerTickEvent
31
import net.ccbluex.liquidbounce.event.events.TransferOrigin
32
import net.ccbluex.liquidbounce.event.events.WorldRenderEvent
33
import net.ccbluex.liquidbounce.event.handler
34
import net.ccbluex.liquidbounce.features.blink.BlinkManager.Action
35
import net.ccbluex.liquidbounce.features.module.ClientModule
36
import net.ccbluex.liquidbounce.features.module.ModuleCategories
37
import net.ccbluex.liquidbounce.features.module.modules.misc.ModuleEasyPearl
38
import net.ccbluex.liquidbounce.render.drawLineStrip
39
import net.ccbluex.liquidbounce.render.engine.type.Color4b
40
import net.ccbluex.liquidbounce.render.renderEnvironment
41
import net.ccbluex.liquidbounce.render.utils.MutableVertexList
42
import net.ccbluex.liquidbounce.utils.aiming.RotationManager
43
import net.ccbluex.liquidbounce.utils.client.notification
44
import net.ccbluex.liquidbounce.utils.network.UseItemPacketRotation
45
import net.ccbluex.liquidbounce.utils.network.sendPacketSilently
46
import net.ccbluex.liquidbounce.utils.entity.SimulatedPlayer
47
import net.ccbluex.liquidbounce.utils.entity.SimulatedPlayerCache
48
import net.ccbluex.liquidbounce.utils.entity.anyHorizontal
49
import net.ccbluex.liquidbounce.utils.input.InputTracker.isPressedOnAny
50
import net.ccbluex.liquidbounce.utils.kotlin.EventPriorityConvention
51
import net.ccbluex.liquidbounce.utils.movement.DirectionalInput
52
import net.minecraft.network.protocol.common.ServerboundPongPacket
53
import net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket
54
import net.minecraft.network.protocol.game.ServerboundAttackPacket
55
import net.minecraft.network.protocol.game.ServerboundInteractPacket
56
import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket
57
import net.minecraft.network.protocol.game.ServerboundSpectatorActionPacket
58
import net.minecraft.network.protocol.game.ServerboundUseItemOnPacket
59
import net.minecraft.network.protocol.game.ServerboundUseItemPacket
60
import java.util.function.BooleanSupplier
61
import kotlin.math.abs
62
import kotlin.random.Random
63
64
/**
65
 * Freeze module
66
 *
67
 * Allows you to freeze yourself without the server knowing.
68
 */
69
object ModuleFreeze : ClientModule("Freeze", ModuleCategories.MOVEMENT, disableOnQuit = true) {
70
71
    private val modes = choices("Mode", Stationary, arrayOf(Queue, Cancel, Stationary, TickMovement))
72
        .apply { tagBy(this) }
73
    private val disableOn by multiEnumChoice("DisableOn", enumSetOf(DisableOn.Flag))
74
    private val notification by boolean("Notification", false)
75
    private val balance by boolean("BalanceWarp", false)
76
77
    private enum class DisableOn(
78
        override val tag: String,
79
        val trigger: BooleanSupplier?,
80
    ) : Tagged {
81
        Flag("Flag", null),
82
        OnGround("OnGround", { player.onGround() }),
83
        OnMovementInput("OnMovementInput", { player.input.keyPresses.anyHorizontal }),
84
        InLiquid("InLiquid", { player.isInLiquid }),
85
        Void("Void", { player.y <= player.level().minY }),
86
        OnUseItem("OnUseItem", { player.isUsingItem }),
87
    }
88
89
    // todo: use global balance system
90
    private var missedOutTick = 0
91
    private var warpInProgress = false
92
93
    override fun onEnabled() {
94
        missedOutTick = 0
95
        super.onEnabled()
96
    }
97
98
    override fun onDisabled() {
99
        if (balance) {
100
            warpInProgress = true
101
            while (missedOutTick > 0) {
102
                // todo: does not run module tick if running at game tick layer
103
                player.tick()
104
                missedOutTick--
105
            }
106
            warpInProgress = false
107
        }
108
109
        missedOutTick = 0
110
        super.onDisabled()
111
    }
112
113
    private fun notifyAndDisable(reason: DisableOn) {
114
        if (notification) {
115
            notification(
116
                this.name,
117
                message("disabled", reason.tag),
118
                NotificationEvent.Severity.INFO
119
            )
120
        }
121
        enabled = false
122
    }
123
124
    private val tickHandler = handler<GameTickEvent> {
125
        for (reason in disableOn) {
126
            if (reason.trigger?.asBoolean ?: continue) {
127
                notifyAndDisable(reason)
128
            }
129
        }
130
    }
131
132
    /**
133
     * Acts as timer = 0 replacement
134
     */
135
    @Suppress("unused")
136
    private val moveHandler = handler<PlayerTickEvent> { event ->
137
        if (warpInProgress || modes.activeMode === TickMovement) return@handler
138
139
        event.cancelEvent()
140
        missedOutTick++
141
    }
142
143
    @Suppress("unused")
144
    val renderHandler = handler<WorldRenderEvent> { event ->
145
        if (!balance || missedOutTick < 0 || warpInProgress) {
146
            return@handler
147
        }
148
149
        // Create a simulated player from the client player, as we cannot use the player simulation cache
150
        // since we are going to modify the player's yaw and pitch
151
        val directionalInput = DirectionalInput(mc.options)
152
153
        val simulatedPlayer = SimulatedPlayer.fromClientPlayer(
154
            SimulatedPlayer.SimulatedPlayerInput.fromClientPlayer(
155
                directionalInput,
156
                mc.options.keyJump.isPressedOnAny,
157
                mc.options.keySprint.isPressedOnAny || player.isSprinting,
158
                mc.options.keyShift.isPressedOnAny
159
            )
160
        )
161
162
        // Alter the simulated player's yaw and pitch to match the camera
163
        simulatedPlayer.yRot = event.camera.yRot()
164
        simulatedPlayer.xRot = event.camera.xRot()
165
166
        // Create a cache for the simulated player
167
        val simulatedPlayerCache = SimulatedPlayerCache(simulatedPlayer)
168
        val cachedPositions = simulatedPlayerCache
169
            .getSnapshotsBetween(0 until this.missedOutTick)
170
171
        event.renderEnvironment {
172
            drawLineStrip(
173
                argb = Color4b(0x00, 0x80, 0xFF, 0xFF).argb,
174
                positions = MutableVertexList(cachedPositions.size)
175
                    .addAllRelativeToCamera(cachedPositions, camera) { it.pos },
176
            )
177
        }
178
    }
179
180
    @Suppress("unused")
181
    private val packetHandler = handler<PacketEvent> { event ->
182
        if (event.packet is ClientboundPlayerPositionPacket) {
183
            missedOutTick = 0
184
            if (DisableOn.Flag in disableOn) {
185
                notifyAndDisable(DisableOn.Flag)
186
            }
187
        }
188
    }
189
190
    /**
191
     * Queue network communication - acts as network lag
192
     */
193
    private object Queue : Mode("Queue") {
194
195
        override val parent: ModeValueGroup<Mode>
196
            get() = modes
197
198
        private val origins by multiEnumChoice("Origin", TransferOrigin.OUTGOING)
199
200
        @Suppress("unused")
201
        private val fakeLagHandler = handler<BlinkPacketEvent>(
202
            priority = EventPriorityConvention.SAFETY_FEATURE
203
        ) { event ->
204
            if (event.origin in origins) {
205
                event.action = Action.QUEUE
206
            }
207
        }
208
209
    }
210
211
    /**
212
     * Cancel network communication
213
     */
214
    private object Cancel : Mode("Cancel") {
215
216
        private val origins by multiEnumChoice("Origin", TransferOrigin.OUTGOING)
217
218
        override val parent: ModeValueGroup<Mode>
219
            get() = modes
220
221
        @Suppress("unused")
222
        private val packetHandler = handler<PacketEvent> { event ->
223
            if (event.origin in origins) {
224
                event.cancelEvent()
225
            }
226
        }
227
228
    }
229
230
    /**
231
     * Stationary freeze - only cancel movement but keeps network communication intact
232
     */
233
    private object Stationary : Mode("Stationary") {
234
        /**
235
         * Bypasses Grim's BadPacketsR and Matrix7 Timer Check
236
         */
237
        private val cancelC0B by boolean("CancelC0B",true)
238
        private val yawOffset = FloatOffsetGenerator()
239
        private val pitchOffset = FloatOffsetGenerator()
240
241
        override val parent: ModeValueGroup<Mode>
242
            get() = modes
243
244
        /**
245
         * Bypasses Grim's duplicate rotation check
246
         */
247
        private class FloatOffsetGenerator : FloatIterator() {
248
            private var prev = 0f
249
            override fun hasNext() = true
250
            override fun nextFloat(): Float {
251
                var offset: Float
252
                do {
253
                    offset = Random.nextDouble(0.002, 0.01).toFloat()
254
                } while (abs(offset - prev) < 1.0E-6F)
255
                return offset.also { prev = it }
256
            }
257
        }
258
259
        @Suppress("unused")
260
        private val packetEventHandler = handler<PacketEvent> { event ->
261
            val yaw = RotationManager.currentRotation?.yaw ?: player.yRot
262
            val pitch = RotationManager.currentRotation?.pitch ?: player.xRot
263
            val yawOffset = yawOffset.nextFloat()
264
            val pitchOffset = pitchOffset.nextFloat()
265
266
            when (val packet = event.packet) {
267
268
                is ServerboundPongPacket -> {
269
                    if (cancelC0B) {
270
                        event.cancelEvent()
271
                    }
272
                }
273
274
                is ServerboundUseItemPacket -> {
275
                    event.cancelEvent()
276
                    sendPacketSilently(
277
                        ServerboundMovePlayerPacket.Rot(
278
                            ModuleEasyPearl.currentTargetRotation?.yaw ?: (player.yRot + yawOffset),
279
                            ModuleEasyPearl.currentTargetRotation?.pitch ?: (player.xRot + pitchOffset),
280
                            player.onGround(),
281
                            player.horizontalCollision
282
                        )
283
                    )
284
                    sendPacketSilently(
285
                        UseItemPacketRotation.createExplicit(
286
                            packet.hand,
287
                            packet.sequence,
288
                            yaw + yawOffset,
289
                            pitch + pitchOffset,
290
                        )
291
                    )
292
                }
293
294
                is ServerboundInteractPacket, is ServerboundAttackPacket, is ServerboundSpectatorActionPacket -> {
295
                    event.cancelEvent()
296
                    sendPacketSilently(
297
                        ServerboundMovePlayerPacket.Rot(
298
                            yaw + yawOffset,
299
                            pitch + pitchOffset,
300
                            player.onGround(),
301
                            player.horizontalCollision
302
                        )
303
                    )
304
                    sendPacketSilently(packet)
305
                }
306
307
                is ServerboundUseItemOnPacket -> {
308
                    event.cancelEvent()
309
                    sendPacketSilently(
310
                        ServerboundMovePlayerPacket.Rot(
311
                            yaw + yawOffset,
312
                            pitch + pitchOffset,
313
                            player.onGround(),
314
                            player.horizontalCollision
315
                        )
316
                    )
317
                    sendPacketSilently(packet)
318
                }
319
            }
320
        }
321
322
    }
323
324
    private object TickMovement : Mode("TickMovement") {
325
326
        private val interval by intRange("Interval", 20..20, 1..200, "ticks")
327
        private var ticksUntilMovement = 0
328
329
        override val parent: ModeValueGroup<Mode>
330
            get() = modes
331
332
        override fun enable() {
333
            ticksUntilMovement = interval.random()
334
        }
335
336
        override fun disable() {
337
            ticksUntilMovement = 0
338
        }
339
340
        @Suppress("unused")
341
        private val movementTickHandler = handler<PlayerMovementTickEvent> { event ->
342
            if (--ticksUntilMovement <= 0) {
343
                ticksUntilMovement = interval.random()
344
                return@handler
345
            }
346
347
            event.cancelEvent()
348
        }
349
350
    }
351
352
}
353