TimerRange module

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

1 implementationCOMBAT

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)COMBATsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/combat/ModuleTimerRange.ktKotlin · 121 lines · 4.5 KB

Accelerates the game time when being within the range of an enemy.

SettingsTimerBalanceLimitNormalSpeedInRangeSpeedBalanceLimitSpeedBoostTimerBalanceRecoveryIncrementDistanceToSpeedUpDistanceToPauseDistanceToStartWorkingPauseOnFlagOnlyOnGroundRequiresKillAura
ModuleTimerRange.ktKotlin · Minecraft 26.2 · 121 lines · 4.5 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.combat
20
21
import net.ccbluex.liquidbounce.config.utils.percentageChance
22
import net.ccbluex.liquidbounce.event.events.PacketEvent
23
import net.ccbluex.liquidbounce.event.handler
24
import net.ccbluex.liquidbounce.event.tickHandler
25
import net.ccbluex.liquidbounce.features.module.ClientModule
26
import net.ccbluex.liquidbounce.features.module.ModuleCategories
27
import net.ccbluex.liquidbounce.features.module.modules.combat.killaura.ModuleKillAura
28
import net.ccbluex.liquidbounce.utils.client.Timer
29
import net.ccbluex.liquidbounce.utils.client.Timer.timerSpeed
30
import net.ccbluex.liquidbounce.utils.combat.findEnemy
31
import net.ccbluex.liquidbounce.utils.kotlin.Priority
32
import net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket
33
34
/**
35
 * TimerRange module
36
 *
37
 * Automatically speeds up when you are near an enemy.
38
 */
39
40
object ModuleTimerRange : ClientModule("TimerRange", ModuleCategories.COMBAT) {
41
42
    private val chance = percentageChance("Chance", 100f)
43
    private val timerBalanceLimit by float("TimerBalanceLimit", 20f, 0f..50f)
44
    private val normalSpeed by float("NormalSpeed", 0.9F, 0.1F..10F)
45
    private val inRangeSpeed by float("InRangeSpeed", 0.95F, 0.1F..10F)
46
    private val balanceLimitSpeed by float("BalanceLimitSpeed", 0.99F, 0.1F..1F)
47
    private val boostSpeed by float("BoostTimer", 2F, 0.1F..10F).apply { tagBy(this) }
48
    private val balanceRecoveryIncrement by float("BalanceRecoveryIncrement", 1f, 1f..10f)
49
    private val distanceToSpeedUp by float("DistanceToSpeedUp", 3.5f, 0f..10f)
50
    private val distanceToPause by float("DistanceToPause", 3f, 0f..10f)
51
    private val distanceToStartWorking by float("DistanceToStartWorking", 100f, 0f..500f)
52
    private val pauseOnFlag by boolean("PauseOnFlag", true)
53
    private val onlyOnGround by boolean("OnlyOnGround", false)
54
55
    private val requiresKillAura by boolean("RequiresKillAura", true)
56
57
    private var reachedTheLimit = false
58
    private var balanceTimer = 0f
59
60
    override fun onEnabled() {
61
        balanceTimer = timerBalanceLimit
62
        super.onEnabled()
63
    }
64
65
    val repeatable = tickHandler {
66
        if (onlyOnGround && !player.onGround()) return@tickHandler
67
        if (requiresKillAura && (!ModuleKillAura.running || ModuleKillAura.targetTracker.target == null)) {
68
            return@tickHandler
69
        }
70
71
        val newTimerSpeed = updateTimerSpeed()
72
73
        if (newTimerSpeed != null) {
74
            Timer.requestTimerSpeed(newTimerSpeed, Priority.IMPORTANT_FOR_USAGE_1, this@ModuleTimerRange)
75
        }
76
77
        val balanceChange = timerSpeed / balanceRecoveryIncrement - 1
78
        if ((balanceTimer > 0 || balanceChange > 0) && (balanceTimer < timerBalanceLimit * 2 || balanceChange < 0)) {
79
            balanceTimer += balanceChange
80
        }
81
82
        if (balanceTimer <= timerBalanceLimit) {
83
            Timer.requestTimerSpeed(balanceLimitSpeed, Priority.IMPORTANT_FOR_USAGE_1, this@ModuleTimerRange)
84
        }
85
86
        if (balanceTimer <= 0) {
87
            reachedTheLimit = false
88
        }
89
    }
90
91
    private fun updateTimerSpeed(): Float? {
92
        if (world.findEnemy(0f, distanceToPause) != null) {
93
            return 1.0f
94
        }
95
96
        if (world.findEnemy(0f, distanceToStartWorking) == null || !chance.asBoolean) {
97
            return null
98
        }
99
100
        if (world.findEnemy(0f, distanceToSpeedUp) == null) {
101
            return normalSpeed
102
        }
103
104
        return if (balanceTimer < timerBalanceLimit * 2 && !reachedTheLimit) {
105
            boostSpeed
106
        } else {
107
            reachedTheLimit = true
108
109
            inRangeSpeed
110
        }
111
    }
112
113
    val packetHandler = handler<PacketEvent> {
114
        if (it.packet is ClientboundPlayerPositionPacket && pauseOnFlag) {
115
            balanceTimer = timerBalanceLimit * 2
116
        }
117
        // Stops speeding up when you get flagged
118
    }
119
120
}
121