TimeShift module

TimeShift: Minecraft 26.3 cheat module, full source for every implementation (1 client: LiquidBounce (Kotlin)).

1 implementationEXPLOIT

Clients with this module

Full module source: 1 implementation

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

LiquidBounce (Kotlin)EXPLOITsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/exploit/ModuleTimeShift.ktKotlin · 173 lines · 6.2 KB

Abuses Minecraft 1.8 mechanics to allow faster regeneration and removes negative status effects like fire and poison.

SettingsHealthIncrementBadEffectsFireMaximumSpeedTimerConditionsPacketType
ModuleTimeShift.ktKotlin · Minecraft 26.2 · 173 lines · 6.2 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.exploit
20
21
import net.ccbluex.liquidbounce.config.types.group.ToggleableValueGroup
22
import net.ccbluex.liquidbounce.config.types.list.Tagged
23
import net.ccbluex.liquidbounce.event.tickHandler
24
import net.ccbluex.liquidbounce.features.module.ClientModule
25
import net.ccbluex.liquidbounce.features.module.ModuleCategories
26
import net.ccbluex.liquidbounce.features.module.modules.exploit.ModuleTimeShift.Health.incrementSpeed
27
import net.ccbluex.liquidbounce.features.module.modules.exploit.ModuleTimeShift.Health.speed
28
import net.ccbluex.liquidbounce.features.module.modules.exploit.ModuleTimeShift.Health.triggerHealth
29
import net.ccbluex.liquidbounce.utils.network.MovePacketType
30
import net.ccbluex.liquidbounce.utils.client.Timer
31
import net.ccbluex.liquidbounce.utils.client.chat
32
import net.ccbluex.liquidbounce.utils.client.isOlderThanOrEqual1_8
33
import net.ccbluex.liquidbounce.utils.client.markAsError
34
import net.ccbluex.liquidbounce.utils.entity.moving
35
import net.ccbluex.liquidbounce.utils.kotlin.Priority
36
import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket
37
import net.minecraft.world.effect.MobEffectCategory
38
import net.minecraft.world.effect.MobEffects
39
import kotlin.math.max
40
import kotlin.math.min
41
42
/**
43
 * Time Shift module
44
 * Formerly known as Regen, Zoot or any other module that abuses Minecraft 1.8 client-sided mechanics
45
 *
46
 * Regen and Zoot are combined into this module to keep the code clean and organized
47
 * and to prevent multiple modules executing time shift at the same time.
48
 *
49
 * FastUse on the other hand is a separate module because it has a few options that are not
50
 * related to time shift.
51
 */
52
object ModuleTimeShift : ClientModule("TimeShift", ModuleCategories.EXPLOIT, disableOnQuit = true,
53
    aliases = listOf("Regen", "Zoot")
54
) {
55
56
    private object Health : ToggleableValueGroup(this, "Health", true) {
57
58
        /**
59
         * The health to trigger the speed
60
         */
61
        private val triggerHealth by int("Health", 16, 0..20)
62
63
        /**
64
         * Calculate the speed to reach the desired health
65
         *
66
         * ([triggerHealth] - [player.health]) * [incrementSpeed] = [speed]
67
         */
68
        private val incrementSpeed by int("Increment", 20, 0..60)
69
70
        val speed: Int
71
            get() = max(0, ((triggerHealth - player.health) * incrementSpeed).toInt())
72
73
    }
74
75
    init {
76
        tree(Health)
77
    }
78
79
    private val badEffects by boolean("BadEffects", false)
80
    private val fire by boolean("Fire", false)
81
82
    private val maximumSpeed by int("MaximumSpeed", 100, 5..200)
83
    private val timer by float("Timer", 1.0f, 0.1f..10f)
84
85
    private val conditions by multiEnumChoice("Conditions", Conditions.NOT_IN_THE_AIR)
86
87
    /**
88
     * The move packet type to send.
89
     *
90
     * @see MovePacketType
91
     * @see ServerboundMovePlayerPacket
92
     *
93
     * [MovePacketType.FULL] is the most likely to bypass, since vanilla 1.17+ clients
94
     * typically send those when using items. Most anticheats have excluded 1.17+ clients
95
     * from timer checks.
96
     *
97
     * AntiCheat: Grim (Tested 2.5.34), Vulcan, Vanilla
98
     * Tested on: eu.loyisa.cn, anticheat-test.com
99
     * Usable Client version: 1.17-1.20.4
100
     * Usable Server version: >=1.8.9
101
     * Q: Why this works?
102
     * A: Legacy servers depend on the clientside tickrate to calculate eating speed.
103
     * Grim exemption: https://github.com/GrimAnticheat/Grim/blob/9660021d024a54634605fbcdf7ce1d631b442da1/src/main/java/ac/grim/grimac/checks/impl/movement/TimerCheck.java#L99
104
     */
105
    private val packetType by enumChoice("PacketType", MovePacketType.FULL)
106
107
    override fun onEnabled() {
108
        if (!isOlderThanOrEqual1_8) {
109
            chat(markAsError(message("warningNot1_8")))
110
        }
111
        super.onEnabled()
112
    }
113
114
    val repeatable = tickHandler {
115
        // Check if the player is in creative mode or dead, if so, skip the time shift
116
        if (player.abilities.instabuild || player.isDeadOrDying) {
117
            return@tickHandler
118
        }
119
120
        if (conditions.any { it.test() }) {
121
            return@tickHandler
122
        }
123
124
        // Calculate the tick speed
125
        var tickSpeed = 0
126
127
        if (Health.enabled) {
128
            tickSpeed = max(tickSpeed, Health.speed)
129
        }
130
131
        if (fire && player.isOnFire && !player.isInWaterOrRain) {
132
            tickSpeed = max(tickSpeed, 9)
133
        }
134
135
        if (badEffects) {
136
            player.activeEffectsMap
137
                .filter { (effect, status) -> effect.value().category == MobEffectCategory.HARMFUL
138
                    && !status.isInfiniteDuration
139
                }
140
                .maxByOrNull { it.value.duration }?.let { (_, status) ->
141
                    tickSpeed = max(tickSpeed, min(status.duration / 20, maximumSpeed))
142
                }
143
        }
144
145
        if (tickSpeed > 0) {
146
            Timer.requestTimerSpeed(timer, Priority.IMPORTANT_FOR_USAGE_1, this@ModuleTimeShift)
147
148
            repeat(tickSpeed) {
149
                network.send(packetType.generatePacket())
150
            }
151
        }
152
    }
153
154
    @Suppress("unused")
155
    private enum class Conditions(
156
        override val tag: String,
157
        val test: () -> Boolean
158
    ) : Tagged {
159
        NOT_IN_THE_AIR("NotInTheAir", {
160
            !player.onGround()
161
        }),
162
        NOT_DURING_MOVE("NotDuringMove", {
163
            player.moving
164
        }),
165
        NOT_DURING_REGENERATION("NotDuringRegeneration", {
166
            player.hasEffect(MobEffects.REGENERATION)
167
        }),
168
        DO_NOT_CAUSE_HUNGER("DoNotCauseHunger", {
169
            player.foodData.foodLevel < 20
170
        })
171
    }
172
}
173