SmoothCamera module

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

1 implementationRENDER

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)RENDERsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/ModuleSmoothCamera.ktKotlin · 86 lines · 2.7 KB

Makes your camera move smoother.

SettingsEnableFirstPOVResetOnPerspectiveChangeHorizontalFactorVerticalFactor
ModuleSmoothCamera.ktKotlin · Minecraft 26.2 · 86 lines · 2.7 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
20
package net.ccbluex.liquidbounce.features.module.modules.render
21
22
import net.ccbluex.liquidbounce.features.module.ClientModule
23
import net.ccbluex.liquidbounce.features.module.ModuleCategories
24
import net.ccbluex.liquidbounce.utils.math.isLikelyZero
25
import net.minecraft.world.phys.Vec3
26
27
/**
28
 * SmoothCamera module
29
 *
30
 * Makes your camera move smoother.
31
 */
32
object ModuleSmoothCamera : ClientModule("SmoothCamera", ModuleCategories.RENDER) {
33
34
    private val enableFirstPOV by boolean("EnableFirstPOV", default = false)
35
    private val resetOnPerspectiveChange by boolean("ResetOnPerspectiveChange", default = true)
36
37
    private val factorH by float("HorizontalFactor", 0.9f, 0f..1f)
38
    private val factorV by float("VerticalFactor", 0.93f, 0f..1f)
39
40
    var smoothPos: Vec3 = Vec3.ZERO
41
        private set
42
43
    private val perspective
44
        get () = mc.options.cameraType
45
46
    private var lastPerspective = perspective
47
48
    override fun onDisabled() {
49
        smoothPos = Vec3.ZERO
50
    }
51
52
    @JvmStatic
53
    fun cameraUpdate(pos: Vec3) {
54
        if (!running) {
55
            lastPerspective = perspective
56
            return
57
        }
58
        // This provides better responsiveness when switching perspectives
59
        if (resetOnPerspectiveChange && lastPerspective != perspective) {
60
            smoothPos = pos
61
            lastPerspective = perspective
62
            return
63
        }
64
        lastPerspective = perspective
65
        // Don't smooth for first person since it looks weird
66
        if (!enableFirstPOV && perspective.isFirstPerson) {
67
            smoothPos = pos
68
            return
69
        }
70
71
        if (smoothPos.isLikelyZero) {
72
            smoothPos = pos
73
        }
74
75
        smoothPos = Vec3(
76
            smoothPos.x * factorH + pos.x * (1 - factorH),
77
            smoothPos.y * factorV + pos.y * (1 - factorV),
78
            smoothPos.z * factorH + pos.z * (1 - factorH)
79
        )
80
    }
81
82
    @JvmStatic
83
    fun shouldApplyChanges(): Boolean = running
84
85
}
86