camera-tweaks module

camera-tweaks: Minecraft 26.3 cheat module, full source for every implementation (1 client: Meteor Client).

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.

Meteor ClientRendersrc/main/java/meteordevelopment/meteorclient/systems/modules/render/CameraTweaks.javaJava · 98 lines · 3.2 KB

Allows modification of the third person camera.

Settingsclipcamera-distancescrollingbindsensitivity
CameraTweaks.javaJava · Minecraft 26.2 · 98 lines · 3.2 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.events.game.ChangePerspectiveEvent;
9
import meteordevelopment.meteorclient.events.meteor.MouseScrollEvent;
10
import meteordevelopment.meteorclient.settings.*;
11
import meteordevelopment.meteorclient.systems.modules.Categories;
12
import meteordevelopment.meteorclient.systems.modules.Module;
13
import meteordevelopment.meteorclient.utils.misc.Keybind;
14
import meteordevelopment.orbit.EventHandler;
15
import net.minecraft.client.CameraType;
16
import com.mojang.blaze3d.platform.InputConstants;
17
18
public class CameraTweaks extends Module {
19
    private final SettingGroup sgGeneral = settings.getDefaultGroup();
20
    private final SettingGroup sgScrolling = settings.createGroup("Scrolling");
21
22
    // General
23
24
    private final Setting<Boolean> clip = sgGeneral.add(new BoolSetting.Builder()
25
        .name("clip")
26
        .description("Allows the camera to clip through blocks.")
27
        .defaultValue(true)
28
        .build()
29
    );
30
31
    private final Setting<Double> cameraDistance = sgGeneral.add(new DoubleSetting.Builder()
32
        .name("camera-distance")
33
        .description("The distance the third person camera is from the player.")
34
        .defaultValue(4)
35
        .min(0)
36
        .onChanged(value -> distance = value)
37
        .build()
38
    );
39
40
    // Scrolling
41
42
    private final Setting<Boolean> scrollingEnabled = sgScrolling.add(new BoolSetting.Builder()
43
        .name("scrolling")
44
        .description("Allows you to scroll to change camera distance.")
45
        .defaultValue(true)
46
        .build()
47
    );
48
49
    private final Setting<Keybind> scrollKeybind = sgScrolling.add(new KeybindSetting.Builder()
50
        .name("bind")
51
        .description("Binds camera distance scrolling to a key.")
52
        .visible(scrollingEnabled::get)
53
        .defaultValue(Keybind.fromKey(InputConstants.KEY_LALT))
54
        .build()
55
    );
56
57
    private final Setting<Double> scrollSensitivity = sgScrolling.add(new DoubleSetting.Builder()
58
        .name("sensitivity")
59
        .description("Sensitivity of the scroll wheel when changing the cameras distance.")
60
        .visible(scrollingEnabled::get)
61
        .defaultValue(1)
62
        .min(0.01)
63
        .build()
64
    );
65
66
    public double distance;
67
68
    public CameraTweaks() {
69
        super(Categories.Render, "camera-tweaks", "Allows modification of the third person camera.");
70
    }
71
72
    @Override
73
    public void onActivate() {
74
        distance = cameraDistance.get();
75
    }
76
77
    @EventHandler
78
    private void onPerspectiveChanged(ChangePerspectiveEvent event) {
79
        distance = cameraDistance.get();
80
    }
81
82
    @EventHandler
83
    private void onMouseScroll(MouseScrollEvent event) {
84
        if (mc.options.getCameraType() == CameraType.FIRST_PERSON || mc.gui.screen() != null || !scrollingEnabled.get() || (scrollKeybind.get().isSet() && !scrollKeybind.get().isPressed()))
85
            return;
86
87
        if (scrollSensitivity.get() > 0) {
88
            distance -= event.value * 0.25 * (scrollSensitivity.get() * distance);
89
90
            event.cancel();
91
        }
92
    }
93
94
    public boolean clip() {
95
        return isActive() && clip.get();
96
    }
97
}
98