CameraClip module

CameraClip: Minecraft 26.3 cheat module, full source for every implementation (2 clients: Combatant, LiquidBounce (Kotlin)).

2 implementationsVISUALSRENDER

Full module source: 2 implementations

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

CombatantVISUALSsrc/main/java/combatant/client/features/module/modules/visuals/CameraClip.javaJava · 91 lines · 2.3 KB
SettingscameraClipDistanceMultipliercameraClipBackOffsetcameraClipRightOffsetcameraClipUpOffset
CameraClip.javaJava · Minecraft 26.2 · 91 lines · 2.3 KB · 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.visuals;
9
10
import combatant.client.config.values.NumberValue;
11
import combatant.client.features.module.Module;
12
import combatant.client.features.module.ModuleCategory;
13
import combatant.client.features.module.ModuleInfo;
14
15
//todo Description
16
@ModuleInfo(
17
        id = "cameraclip",
18
        displayName = "CameraClip",
19
        category = ModuleCategory.VISUALS
20
)
21
public final class CameraClip extends Module {
22
23
    private final NumberValue<Double> distanceMultiplier =
24
            num(
25
                    "cameraClipDistanceMultiplier",
26
                    "distance_multiplier",
27
                    1.0,
28
                    0.1,
29
                    5.0
30
            );
31
32
    private final NumberValue<Double> backOffset =
33
            num(
34
                    "cameraClipBackOffset",
35
                    "back_offset",
36
                    0.0,
37
                    -10.0,
38
                    10.0
39
            );
40
41
    private final NumberValue<Double> rightOffset =
42
            num(
43
                    "cameraClipRightOffset",
44
                    "right_offset",
45
                    0.0,
46
                    -10.0,
47
                    10.0
48
            );
49
50
    private final NumberValue<Double> upOffset =
51
            num(
52
                    "cameraClipUpOffset",
53
                    "up_offset",
54
                    0.0,
55
                    -10.0,
56
                    10.0
57
            );
58
59
    public double getDistanceMultiplier() {
60
        return isEnabled() ? distanceMultiplier.get() : 1.0;
61
    }
62
63
    public double getBackOffset() {
64
        return isEnabled() ? backOffset.get() : 0.0;
65
    }
66
67
    public double getRightOffset() {
68
        return isEnabled() ? rightOffset.get() : 0.0;
69
    }
70
71
    public double getUpOffset() {
72
        return isEnabled() ? upOffset.get() : 0.0;
73
    }
74
75
    public float distanceMultiplier() {
76
        return (float) getDistanceMultiplier();
77
    }
78
79
    public float backOffset() {
80
        return (float) getBackOffset();
81
    }
82
83
    public float rightOffset() {
84
        return (float) getRightOffset();
85
    }
86
87
    public float upOffset() {
88
        return (float) getUpOffset();
89
    }
90
}
91
LiquidBounce (Kotlin)RENDERsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/cameraclip/ModuleCameraClip.ktKotlin · 131 lines · 4.6 KB

Allows you to clip the camera through walls in third person mode.

SettingsSpeedEasingRememberScrolledRequireFreeLook
ModuleCameraClip.ktKotlin · Minecraft 26.2 · 131 lines · 4.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
20
package net.ccbluex.liquidbounce.features.module.modules.render.cameraclip
21
22
import com.mojang.blaze3d.platform.InputConstants
23
import net.ccbluex.liquidbounce.config.types.group.ToggleableValueGroup
24
import net.ccbluex.liquidbounce.event.events.KeyboardKeyEvent
25
import net.ccbluex.liquidbounce.event.events.PerspectiveEvent
26
import net.ccbluex.liquidbounce.event.handler
27
import net.ccbluex.liquidbounce.features.module.ClientModule
28
import net.ccbluex.liquidbounce.features.module.ModuleCategories
29
import net.ccbluex.liquidbounce.features.module.modules.render.ModuleFreeLook
30
import net.ccbluex.liquidbounce.utils.input.isPressed
31
import net.ccbluex.liquidbounce.utils.kotlin.EventPriorityConvention
32
import net.ccbluex.liquidbounce.utils.math.Easing
33
import net.minecraft.client.CameraType
34
import net.minecraft.util.Mth
35
36
/**
37
 * CameraClip module
38
 *
39
 * Allows you to see through walls in third person view.
40
 *
41
 * @author 1zun4, sqlerrorthing
42
 */
43
object ModuleCameraClip : ClientModule("CameraClip", ModuleCategories.RENDER) {
44
    private val cameraDistance = float("CameraDistance", 4f, 1f..48f)
45
46
    init {
47
        tree(Animation)
48
        tree(ScrollAdjust)
49
    }
50
51
    val distance
52
        get() = when {
53
            ScrollAdjust.running -> ScrollAdjust.scrolledDistance
54
            else -> cameraDistance.get()
55
        }
56
57
    @Suppress("unused")
58
    private val perspectiveHandler = handler<PerspectiveEvent> { event ->
59
        event.noClip = true
60
    }
61
62
    private object Animation: ToggleableValueGroup(this, "Animation", true) {
63
        private val speed by float("Speed", 0.6f, 0.1f..1f)
64
        private val easing by easing("Easing", Easing.LINEAR)
65
66
        @Suppress("unused")
67
        private val perspectiveHandler = handler<PerspectiveEvent> { event ->
68
            if (event.lastPerspective != event.perspective) {
69
                event.lastDistance = 0f
70
            }
71
            if (event.perspective != CameraType.FIRST_PERSON) {
72
                event.distance = Mth.lerp(easing.transform(speed), event.lastDistance, distance)
73
            }
74
        }
75
    }
76
77
    private object ScrollAdjust : ScrollAdjustValueGroup(
78
        ModuleCameraClip,
79
        "ScrollAdjust",
80
        true,
81
        { delta -> ScrollAdjust.scrolledDistance += delta },
82
        ScrollAdjustOptions(
83
            modifierKeyDefault = InputConstants.KEY_LCONTROL,
84
            sensitivityDefault = 0.3f,
85
            sensitivityRange = 0.1f..2f
86
        )
87
    ) {
88
        private val rememberScrolled by boolean("RememberScrolled", false)
89
        private val requireFreeLook by boolean("RequireFreeLook", false)
90
91
        var scrolledDistance = cameraDistance.get()
92
            private set(value) {
93
                @Suppress("UNCHECKED_CAST")
94
                field = value.coerceIn(cameraDistance.range as ClosedFloatingPointRange<Float>)
95
            }
96
97
        override fun canPerformScroll(): Boolean =
98
            (modifierKey == InputConstants.UNKNOWN || modifierKey.isPressed)
99
                && (!requireFreeLook || ModuleFreeLook.running)
100
                && (mc.options.cameraType != CameraType.FIRST_PERSON || ModuleFreeLook.running)
101
102
        @Suppress("unused")
103
        private val resetHandler = handler<PerspectiveEvent>(
104
            priority = EventPriorityConvention.READ_FINAL_STATE
105
        ) { event ->
106
            if (event.perspective == CameraType.FIRST_PERSON) {
107
                reset()
108
            }
109
        }
110
111
        @Suppress("unused")
112
        private val releaseModifierHandler = handler<KeyboardKeyEvent> {
113
            if (it.key == modifierKey && it.isReleased) {
114
                reset()
115
            }
116
        }
117
118
        fun reset() {
119
            if (rememberScrolled && scrolledDistance != cameraDistance.get()) {
120
                cameraDistance.set(scrolledDistance)
121
            } else {
122
                scrolledDistance = cameraDistance.get()
123
            }
124
        }
125
126
        override fun onEnabled() {
127
            reset()
128
        }
129
    }
130
}
131