zoom module

zoom: Minecraft 26.3 cheat module, full source for every implementation (5 clients: Meteor Client, OfflineClient, Combatant, …).

5 implementationsRenderRENDERVISUALS

Full module source: 5 implementations

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

Meteor ClientRendersrc/main/java/meteordevelopment/meteorclient/systems/modules/render/Zoom.javaJava · 175 lines · 5.3 KB

Zooms your view.

Settingsscroll-sensitivitysmoothcinematichide-HUDshow-hands
Zoom.javaJava · Minecraft 26.2 · 175 lines · 5.3 KB · complete file, verbatimOriginal ↗
1
/*
2
 * This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
3
 * Copyright (c) Meteor Development.
4
 */
5
6
package meteordevelopment.meteorclient.systems.modules.render;
7
8
import meteordevelopment.meteorclient.MeteorClient;
9
import meteordevelopment.meteorclient.events.meteor.KeyInputEvent;
10
import meteordevelopment.meteorclient.events.meteor.MouseScrollEvent;
11
import meteordevelopment.meteorclient.events.render.GetFovEvent;
12
import meteordevelopment.meteorclient.events.render.Render3DEvent;
13
import meteordevelopment.meteorclient.events.world.TickEvent;
14
import meteordevelopment.meteorclient.settings.BoolSetting;
15
import meteordevelopment.meteorclient.settings.DoubleSetting;
16
import meteordevelopment.meteorclient.settings.Setting;
17
import meteordevelopment.meteorclient.settings.SettingGroup;
18
import meteordevelopment.meteorclient.systems.modules.Categories;
19
import meteordevelopment.meteorclient.systems.modules.Module;
20
import meteordevelopment.orbit.EventHandler;
21
import net.minecraft.util.Mth;
22
import com.mojang.blaze3d.platform.InputConstants;
23
24
public class Zoom extends Module {
25
    private final SettingGroup sgGeneral = settings.getDefaultGroup();
26
27
    private final Setting<Double> zoom = sgGeneral.add(new DoubleSetting.Builder()
28
        .name("zoom")
29
        .description("How much to zoom.")
30
        .defaultValue(6)
31
        .min(1)
32
        .build()
33
    );
34
35
    private final Setting<Double> scrollSensitivity = sgGeneral.add(new DoubleSetting.Builder()
36
        .name("scroll-sensitivity")
37
        .description("Allows you to change zoom value using scroll wheel. 0 to disable.")
38
        .defaultValue(1)
39
        .min(0)
40
        .build()
41
    );
42
43
    private final Setting<Boolean> smooth = sgGeneral.add(new BoolSetting.Builder()
44
        .name("smooth")
45
        .description("Smooth transition.")
46
        .defaultValue(true)
47
        .build()
48
    );
49
50
    private final Setting<Boolean> cinematic = sgGeneral.add(new BoolSetting.Builder()
51
        .name("cinematic")
52
        .description("Enables cinematic camera.")
53
        .defaultValue(false)
54
        .build()
55
    );
56
57
    private final Setting<Boolean> hideHud = sgGeneral.add(new BoolSetting.Builder()
58
        .name("hide-HUD")
59
        .description("Whether or not to hide the Minecraft HUD.")
60
        .defaultValue(false)
61
        .build()
62
    );
63
64
    private final Setting<Boolean> renderHands = sgGeneral.add(new BoolSetting.Builder()
65
        .name("show-hands")
66
        .description("Whether or not to render your hands.")
67
        .defaultValue(false)
68
        .visible(() -> !hideHud.get())
69
        .build()
70
    );
71
72
    private boolean enabled;
73
    private boolean preCinematic;
74
    private double preMouseSensitivity;
75
    private double value;
76
    private double time;
77
78
    private boolean hudManualToggled;
79
80
    public Zoom() {
81
        super(Categories.Render, "zoom", "Zooms your view.");
82
        autoSubscribe = false;
83
    }
84
85
    @Override
86
    public void onActivate() {
87
        if (!enabled) {
88
            preCinematic = mc.options.smoothCamera;
89
            preMouseSensitivity = mc.options.sensitivity().get();
90
            value = zoom.get();
91
            time = 0.001;
92
93
            MeteorClient.EVENT_BUS.subscribe(this);
94
            enabled = true;
95
        }
96
97
        if (hideHud.get() && !mc.gameRenderer.gameRenderState().guiRenderState.isHudHidden) {
98
            hudManualToggled = false;
99
            mc.gameRenderer.gameRenderState().guiRenderState.isHudHidden = true;
100
        }
101
    }
102
103
    @Override
104
    public void onDeactivate() {
105
        if (hideHud.get() && !hudManualToggled) {
106
            mc.gameRenderer.gameRenderState().guiRenderState.isHudHidden = false;
107
        }
108
    }
109
110
    @EventHandler
111
    public void onKeyPressed(KeyInputEvent event) {
112
        if (event.key() != InputConstants.KEY_F1) return;
113
        hudManualToggled = true;
114
    }
115
116
    public void onStop() {
117
        mc.options.smoothCamera = preCinematic;
118
        mc.options.sensitivity().set(preMouseSensitivity);
119
    }
120
121
    @EventHandler
122
    private void onTick(TickEvent.Post event) {
123
        mc.options.smoothCamera = cinematic.get();
124
125
        if (!cinematic.get()) {
126
            mc.options.sensitivity().set(preMouseSensitivity / Math.max(getScaling() * 0.5, 1));
127
        }
128
129
        if (time == 0) {
130
            MeteorClient.EVENT_BUS.unsubscribe(this);
131
            enabled = false;
132
133
            onStop();
134
        }
135
    }
136
137
    @EventHandler
138
    private void onMouseScroll(MouseScrollEvent event) {
139
        if (mc.gui.screen() != null) return;
140
141
        if (scrollSensitivity.get() > 0 && isActive()) {
142
            value += event.value * 0.25 * (scrollSensitivity.get() * value);
143
            value = Math.max(value, 1);
144
            event.cancel();
145
        }
146
    }
147
148
    @EventHandler
149
    private void onRender3D(Render3DEvent event) {
150
        if (!smooth.get()) {
151
            time = isActive() ? 1 : 0;
152
            return;
153
        }
154
155
        if (isActive()) time += event.frameTime * 5;
156
        else time -= event.frameTime * 5;
157
158
        time = Mth.clamp(time, 0, 1);
159
    }
160
161
    @EventHandler
162
    private void onGetFov(GetFovEvent event) {
163
        event.fov /= (float) getScaling();
164
    }
165
166
    public double getScaling() {
167
        double delta = time < 0.5 ? 4 * time * time * time : 1 - Math.pow(-2 * time + 2, 3) / 2; // Ease in out cubic
168
        return Mth.lerp(delta, 1, value);
169
    }
170
171
    public boolean renderHands() {
172
        return !isActive() || renderHands.get();
173
    }
174
}
175
OfflineClientRENDERsrc/main/java/com/jellypudding/offlineclient/modules/render/Zoom.javaJava · 129 lines · 4.5 KB

Zooms your view.

SettingsFactorScroll sensitivitySmoothCinematicHide HUDShow hands
Zoom.javaJava · Minecraft 26.2 · 129 lines · 4.5 KB · complete file, verbatimOriginal ↗
1
package com.jellypudding.offlineclient.modules.render;
2
3
import com.jellypudding.offlineclient.event.Subscribe;
4
import com.jellypudding.offlineclient.event.events.MouseScrollEvent;
5
import com.jellypudding.offlineclient.event.events.TickEvent;
6
import com.jellypudding.offlineclient.module.Category;
7
import com.jellypudding.offlineclient.module.Module;
8
import com.jellypudding.offlineclient.setting.BoolSetting;
9
import com.jellypudding.offlineclient.setting.NumberSetting;
10
import org.lwjgl.glfw.GLFW;
11
12
// CameraMixin applies the FOV change at read time.
13
// Saved video settings are never touched.
14
public final class Zoom extends Module {
15
16
    // Share of the remaining distance the ease covers each frame.
17
    private static final double EASE = 0.3;
18
19
    // Below this the ease has arrived.
20
    private static final double SETTLED = 0.005;
21
22
    // Share of the current zoom that one wheel notch moves it by.
23
    private static final double NOTCH_SHARE = 0.25;
24
25
    private final NumberSetting factor = new NumberSetting("Factor",
26
        "How far to zoom in.", 4, 2, 10, 0.5, "x").min(1);
27
    private final NumberSetting scrollSensitivity = new NumberSetting("Scroll sensitivity",
28
        "How much a wheel notch changes the zoom. Zero leaves the wheel to the hotbar.",
29
        1, 0, 5, 0.1).min(0);
30
    private final BoolSetting smooth = new BoolSetting("Smooth",
31
        "Ease into the zoom instead of snapping to it.", true);
32
    private final BoolSetting cinematic = new BoolSetting("Cinematic",
33
        "Use the slow cinematic camera whilst zoomed.", false);
34
    private final BoolSetting hideHud = new BoolSetting("Hide HUD",
35
        "Hide the game overlay whilst zoomed.", false);
36
    private final BoolSetting showHands = new BoolSetting("Show hands",
37
        "Keep drawing your hands whilst zoomed.", false);
38
39
    private double smoothed = 1;
40
41
    // What the game settings were before the zoom touched them.
42
    private boolean savedCinematic;
43
    private double savedSensitivity = 1;
44
    private boolean hidHud;
45
46
    public Zoom() {
47
        super("Zoom", "Zooms your view.", Category.RENDER, GLFW.GLFW_KEY_C);
48
        addSettings(factor, scrollSensitivity, smooth, cinematic, hideHud, showHands);
49
    }
50
51
    @Override
52
    public String getSuffix() {
53
        return factor.getValueString();
54
    }
55
56
    // A zoom left on at shutdown would come back with the mouse still slowed.
57
    @Override
58
    public boolean savesEnabledState() {
59
        return false;
60
    }
61
62
    @Override
63
    protected void onEnable() {
64
        savedCinematic = mc.options.smoothCamera;
65
        savedSensitivity = mc.options.sensitivity().get();
66
        hidHud = hideHud.isOn() && !mc.gui.hud.isHidden();
67
        if (hidHud) {
68
            mc.gui.hud.toggle();
69
        }
70
        apply();
71
    }
72
73
    @Override
74
    protected void onDisable() {
75
        mc.options.smoothCamera = savedCinematic;
76
        mc.options.sensitivity().set(savedSensitivity);
77
        // Left alone if the player has hidden or shown the HUD since.
78
        if (hidHud && mc.gui.hud.isHidden()) {
79
            mc.gui.hud.toggle();
80
        }
81
        hidHud = false;
82
    }
83
84
    // Picks up a setting change made whilst the zoom is running.
85
    @Subscribe
86
    private void onTick(TickEvent event) {
87
        apply();
88
    }
89
90
    @Subscribe
91
    private void onScroll(MouseScrollEvent event) {
92
        double strength = scrollSensitivity.getValue();
93
        if (strength <= 0 || mc.gui.screen() != null) {
94
            return;
95
        }
96
        double current = factor.getValue();
97
        factor.setValue(current + event.getAmount() * NOTCH_SHARE * strength * current);
98
        event.cancel();
99
    }
100
101
    // A steadier aim the further in you are. The cinematic camera does that on its own.
102
    private void apply() {
103
        mc.options.smoothCamera = savedCinematic || cinematic.isOn();
104
        double divisor = cinematic.isOn() ? 1 : Math.max(1, factor.getValue() / 2);
105
        mc.options.sensitivity().set(savedSensitivity / divisor);
106
    }
107
108
    // Eases the zoom once per camera update. The world and hand read the same value.
109
    public void advance() {
110
        double target = isEnabled() ? factor.getValue() : 1;
111
        if (!smooth.isOn()) {
112
            smoothed = target;
113
            return;
114
        }
115
        smoothed += (target - smoothed) * EASE;
116
        if (Math.abs(smoothed - target) < SETTLED) {
117
            smoothed = target;
118
        }
119
    }
120
121
    public boolean hidesHand() {
122
        return isEnabled() && !showHands.isOn();
123
    }
124
125
    public float applyZoom(float fov) {
126
        return (float) (fov / smoothed);
127
    }
128
}
129
CombatantVISUALSsrc/main/java/combatant/client/features/module/modules/visuals/Zoom.javaJava · 114 lines · 4.0 KB
Settingszoom_divisorzoom_animationzoom_smooth_inzoom_smooth_outzoom_sensitivity_percent
Zoom.javaJava · Minecraft 26.2 · 114 lines · 4.0 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 net.minecraft.util.Mth;
11
import combatant.client.config.values.BindMode;
12
import combatant.client.config.values.EnumValue;
13
import combatant.client.config.values.NumberValue;
14
import combatant.client.features.gui.clickgui.settings.FunctionBindSetting;
15
import combatant.client.features.module.Module;
16
import combatant.client.features.module.ModuleCategory;
17
import combatant.client.features.module.ModuleInfo;
18
import combatant.client.render.engine.animation.AnimationUtility;
19
20
@ModuleInfo(
21
        id = "zoom",
22
        displayName = "Zoom",
23
        category = ModuleCategory.VISUALS
24
)
25
public final class Zoom extends Module {
26
    private static final String ACTION_ZOOM_HOLD = "zoom_hold";
27
    private static final float EPSILON = 0.0005f;
28
29
    private final FunctionBindSetting zoomHoldAction = action(ACTION_ZOOM_HOLD, "C", BindMode.HOLD);
30
    private final NumberValue<Float> zoomDivisor = num("zoom_divisor", 4.0f, 1.0f, 30.0f);
31
    private final EnumValue<AnimationMode> animation = enumSetting("zoom_animation", "animation", AnimationMode.EASE_OUT_CUBIC);
32
    private final NumberValue<Float> smoothIn = num("zoom_smooth_in", "smooth_in", 0.25f, 0.0f, 1.0f);
33
    private final NumberValue<Float> smoothOut = num("zoom_smooth_out", "smooth_out", 0.25f, 0.0f, 1.0f);
34
    private final NumberValue<Integer> sensitivityPercent = num(
35
            "zoom_sensitivity_percent",
36
            "sensitivity_percent",
37
            100,
38
            0,
39
            100
40
    );
41
42
    private boolean zooming;
43
    private float progress;
44
    private float currentDivisor = 1.0f;
45
46
    @Override
47
    public void onFrame(float tickDelta) {
48
        boolean held = isActionHeld(ACTION_ZOOM_HOLD);
49
        zooming = held;
50
51
        float targetProgress = held ? 1.0f : 0.0f;
52
        float smooth = Mth.clamp(held ? smoothIn.get() : smoothOut.get(), 0.0f, 1.0f);
53
        if (smooth <= EPSILON) {
54
            progress = targetProgress;
55
        } else {
56
            float dt = AnimationUtility.deltaTime();
57
            float speed = Mth.lerp(smooth, 5.0f, 28.0f);
58
            progress = AnimationUtility.approach(progress, targetProgress, dt, speed);
59
            progress = AnimationUtility.snap(progress, targetProgress, 0.001f);
60
        }
61
62
        progress = AnimationUtility.clamp01(progress);
63
64
        float targetDivisor = Math.max(1.0f, zoomDivisor.get());
65
        float eased = animation.get().apply(progress);
66
        currentDivisor = Math.max(1.0f, AnimationUtility.lerp(1.0f, targetDivisor, eased));
67
    }
68
69
    @Override
70
    public void onDisable() {
71
        zooming = false;
72
        progress = 0.0f;
73
        currentDivisor = 1.0f;
74
    }
75
76
    public boolean isZooming() {
77
        return zooming;
78
    }
79
80
    public boolean shouldApplyZoom() {
81
        return zooming || currentDivisor > 1.0005f || progress > EPSILON;
82
    }
83
84
    public float getZoomDivisor() {
85
        return Math.max(1.0f, currentDivisor);
86
    }
87
88
    public float getSensitivityPercent() {
89
        return Mth.clamp(sensitivityPercent.get(), 0, 100);
90
    }
91
92
    public enum AnimationMode {
93
        LINEAR,
94
        SMOOTHSTEP,
95
        EASE_IN_CUBIC,
96
        EASE_OUT_CUBIC,
97
        EASE_IN_OUT_CUBIC,
98
        EASE_OUT_BACK,
99
        EASE_IN_BACK;
100
101
        public float apply(float value) {
102
            return switch (this) {
103
                case LINEAR -> AnimationUtility.clamp01(value);
104
                case SMOOTHSTEP -> AnimationUtility.smoothstep(value);
105
                case EASE_IN_CUBIC -> AnimationUtility.easeInCubic(value);
106
                case EASE_OUT_CUBIC -> AnimationUtility.easeOutCubic(value);
107
                case EASE_IN_OUT_CUBIC -> AnimationUtility.easeInOutCubic(value);
108
                case EASE_OUT_BACK -> AnimationUtility.easeOutBack(value, 0.95f);
109
                case EASE_IN_BACK -> AnimationUtility.easeInBack(value, 0.95f);
110
            };
111
        }
112
    }
113
}
114
NicotineRendersrc/client/java/nicotine/mod/mods/render/Zoom.javaJava · 69 lines · 2.0 KB

Adjust with mouse wheel while zoomed in

SettingsFOV
Zoom.javaJava · Minecraft 26.3 · 69 lines · 2.0 KB · complete file, verbatimOriginal ↗
1
package nicotine.mod.mods.render;
2
3
import com.mojang.blaze3d.platform.InputConstants;
4
import net.minecraft.client.OptionInstance;
5
import net.minecraft.client.gui.screens.ChatScreen;
6
import nicotine.events.MouseScrollEvent;
7
import nicotine.screens.clickgui.BaseScreen;
8
import nicotine.events.ClientLevelTickEvent;
9
import nicotine.mod.Mod;
10
import nicotine.mod.ModCategory;
11
import nicotine.mod.option.SliderOption;
12
import nicotine.util.EventBus;
13
import nicotine.util.Keybind;
14
15
import static nicotine.util.Common.mc;
16
17
public class Zoom extends Mod {
18
    private int defaultFov = 0;
19
20
    private final SliderOption zoomFov = new SliderOption(
21
            "FOV",
22
            10,
23
            5,
24
            30
25
    );
26
27
    public Zoom() {
28
        super(ModCategory.Render, "Zoom", "Adjust with mouse wheel while zoomed in");
29
30
        this.keybind.keyCode = InputConstants.KEY_C;
31
        this.addOptions(zoomFov);
32
    }
33
34
    @Override
35
    protected void init() {
36
        OptionInstance<Integer> fovOption = mc.options.fov();
37
38
        EventBus.register(ClientLevelTickEvent.class, event -> {
39
            if (!this.enabled || !Keybind.keyDown(keybind.keyCode) ||
40
                    mc.gui.screen() instanceof ChatScreen || mc.gui.screen() instanceof BaseScreen) {
41
                int fov =  fovOption.get();
42
                if (fov == zoomFov.value)
43
                    fovOption.set(defaultFov);
44
                else
45
                    defaultFov = fov;
46
                return true;
47
            }
48
49
            fovOption.set((int)zoomFov.value);
50
51
            return true;
52
        });
53
54
        EventBus.register(MouseScrollEvent.class, event -> {
55
            if (Keybind.keyDown(keybind.keyCode)) {
56
                if (event.cords.y == 1 && zoomFov.value > zoomFov.minValue) {
57
                    zoomFov.value--;
58
                } else if (event.cords.y == -1 && zoomFov.value < zoomFov.maxValue) {
59
                    zoomFov.value++;
60
                }
61
62
                return false;
63
            }
64
65
            return true;
66
        });
67
    }
68
}
69
LiquidBounce (Kotlin)RENDERsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/ModuleZoom.ktKotlin · 114 lines · 3.6 KB

Allows you to make everything in your world appear smaller or bigger.

SettingsSpeedTransitionDurationFactor
ModuleZoom.ktKotlin · Minecraft 26.2 · 114 lines · 3.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.render
20
21
import net.ccbluex.liquidbounce.config.types.group.ToggleableValueGroup
22
import net.ccbluex.liquidbounce.event.events.MouseScrollInHotbarEvent
23
import net.ccbluex.liquidbounce.event.handler
24
import net.ccbluex.liquidbounce.features.module.ClientModule
25
import net.ccbluex.liquidbounce.features.module.ModuleCategories
26
import net.ccbluex.liquidbounce.injection.mixins.minecraft.client.MixinMouseHandler
27
import net.ccbluex.liquidbounce.utils.client.Chronometer
28
import net.ccbluex.liquidbounce.utils.input.InputBind
29
import net.ccbluex.liquidbounce.utils.math.Easing
30
import net.minecraft.util.Mth
31
import kotlin.math.abs
32
import kotlin.math.round
33
34
/**
35
 * Module Zoom
36
 *
37
 * Allows you to zoom.
38
 *
39
 * The mouse is slowed down with the help of mixins in [MixinMouseHandler].
40
 */
41
object ModuleZoom : ClientModule("Zoom", ModuleCategories.RENDER, bindAction = InputBind.BindAction.HOLD) {
42
43
    val zoom by int("Zoom", 30, 10..150)
44
45
    object Scroll : ToggleableValueGroup(this, "Scroll", true) {
46
47
        val speed by float("Speed", 2f, 0.5f..8f)
48
49
        @Suppress("unused")
50
        val onScroll = handler<MouseScrollInHotbarEvent> {
51
            previousFov = getFov(true)
52
            targetFov = (targetFov - round(it.speed * this.speed).toInt()).coerceIn(1, 179)
53
            reset()
54
            it.cancelEvent()
55
        }
56
57
    }
58
59
    init {
60
        tree(Scroll)
61
    }
62
63
    private val transition by easing("Transition", Easing.QUAD_IN)
64
    private val durationFactor by float("DurationFactor", 2f, 0f..10f, "x")
65
66
    private val chronometer = Chronometer()
67
    private var targetFov = 0
68
    private var previousFov = 0
69
    private var scaledDifference = 0.0
70
    private var disableAnimationFinished = true
71
72
    override fun onEnabled() {
73
        targetFov = zoom
74
        previousFov = getDefaultFov()
75
        reset()
76
    }
77
78
    override fun onDisabled() {
79
        previousFov = getFov(true)
80
        chronometer.reset()
81
        targetFov = getDefaultFov()
82
        reset()
83
        disableAnimationFinished = false
84
    }
85
86
    fun getFov(enabled: Boolean, original: Int = 0): Int {
87
        if (!enabled && disableAnimationFinished) {
88
            return original
89
        }
90
91
        val factor = if (scaledDifference <= 0.0 || !scaledDifference.isFinite()) {
92
            1f
93
        } else {
94
            (chronometer.elapsed / scaledDifference).toFloat().coerceIn(0F, 1F)
95
        }
96
        if (!enabled && factor == 1f) {
97
            disableAnimationFinished = true
98
        }
99
100
        return Mth.lerpInt(transition.transform(factor), previousFov, targetFov)
101
    }
102
103
    private fun getDefaultFov(): Int {
104
        val fov = mc.options.fov().get()
105
        return if (ModuleNoFov.running) ModuleNoFov.getFov(fov) else fov
106
    }
107
108
    private fun reset() {
109
        chronometer.reset()
110
        scaledDifference = durationFactor.toDouble() * abs(targetFov - previousFov)
111
    }
112
113
}
114