gui-move module

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

1 implementationMovement

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 ClientMovementsrc/main/java/meteordevelopment/meteorclient/systems/modules/movement/GUIMove.javaJava · 190 lines · 6.8 KB

Allows you to perform various actions while in GUIs.

Settingsguisjumpsneaksprintarrows-rotaterotate-speed
GUIMove.javaJava · Minecraft 26.2 · 190 lines · 6.8 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.movement;
7
8
import meteordevelopment.meteorclient.events.meteor.KeyInputEvent;
9
import meteordevelopment.meteorclient.events.meteor.MouseClickEvent;
10
import meteordevelopment.meteorclient.events.render.Render3DEvent;
11
import meteordevelopment.meteorclient.gui.WidgetScreen;
12
import meteordevelopment.meteorclient.mixin.CreativeModeInventoryScreenAccessor;
13
import meteordevelopment.meteorclient.settings.*;
14
import meteordevelopment.meteorclient.systems.modules.Categories;
15
import meteordevelopment.meteorclient.systems.modules.Module;
16
import meteordevelopment.meteorclient.systems.modules.Modules;
17
import meteordevelopment.meteorclient.systems.modules.render.Freecam;
18
import meteordevelopment.meteorclient.utils.misc.input.Input;
19
import meteordevelopment.meteorclient.utils.misc.input.KeyAction;
20
import meteordevelopment.orbit.EventHandler;
21
import net.minecraft.client.KeyMapping;
22
import net.minecraft.client.gui.screens.ChatScreen;
23
import net.minecraft.client.gui.screens.inventory.*;
24
import net.minecraft.util.Mth;
25
import net.minecraft.world.item.CreativeModeTabs;
26
27
import static com.mojang.blaze3d.platform.InputConstants.*;
28
29
public class GUIMove extends Module {
30
    public enum Screens {
31
        GUI,
32
        Inventory,
33
        Both
34
    }
35
36
    private final SettingGroup sgGeneral = settings.getDefaultGroup();
37
38
    private final Setting<Screens> screens = sgGeneral.add(new EnumSetting.Builder<Screens>()
39
        .name("guis")
40
        .description("Which GUIs to move in.")
41
        .defaultValue(Screens.Inventory)
42
        .build()
43
    );
44
45
    public final Setting<Boolean> jump = sgGeneral.add(new BoolSetting.Builder()
46
        .name("jump")
47
        .description("Allows you to jump while in GUIs.")
48
        .defaultValue(true)
49
        .onChanged(aBoolean -> {
50
            if (isActive() && !aBoolean) mc.options.keyJump.setDown(false);
51
        })
52
        .build()
53
    );
54
55
    public final Setting<Boolean> sneak = sgGeneral.add(new BoolSetting.Builder()
56
        .name("sneak")
57
        .description("Allows you to sneak while in GUIs.")
58
        .defaultValue(true)
59
        .onChanged(aBoolean -> {
60
            if (isActive() && !aBoolean) mc.options.keyShift.setDown(false);
61
        })
62
        .build()
63
    );
64
65
    public final Setting<Boolean> sprint = sgGeneral.add(new BoolSetting.Builder()
66
        .name("sprint")
67
        .description("Allows you to sprint while in GUIs.")
68
        .defaultValue(true)
69
        .onChanged(aBoolean -> {
70
            if (isActive() && !aBoolean) mc.options.keySprint.setDown(false);
71
        })
72
        .build()
73
    );
74
75
    private final Setting<Boolean> arrowsRotate = sgGeneral.add(new BoolSetting.Builder()
76
        .name("arrows-rotate")
77
        .description("Allows you to use your arrow keys to rotate while in GUIs.")
78
        .defaultValue(true)
79
        .build()
80
    );
81
82
    private final Setting<Double> rotateSpeed = sgGeneral.add(new DoubleSetting.Builder()
83
        .name("rotate-speed")
84
        .description("Rotation speed while in GUIs.")
85
        .defaultValue(4)
86
        .min(0)
87
        .build()
88
    );
89
90
    public GUIMove() {
91
        super(Categories.Movement, "gui-move", "Allows you to perform various actions while in GUIs.");
92
    }
93
94
    @Override
95
    public void onDeactivate() {
96
        mc.options.keyUp.setDown(false);
97
        mc.options.keyDown.setDown(false);
98
        mc.options.keyLeft.setDown(false);
99
        mc.options.keyRight.setDown(false);
100
101
        if (jump.get()) mc.options.keyJump.setDown(false);
102
        if (sneak.get()) mc.options.keyShift.setDown(false);
103
        if (sprint.get()) mc.options.keySprint.setDown(false);
104
    }
105
106
    public boolean disableSpace() {
107
        return isActive() && jump.get() && mc.options.keyJump.isDefault();
108
    }
109
110
    public boolean disableArrows() {
111
        return isActive() && arrowsRotate.get();
112
    }
113
114
    @EventHandler
115
    private void onKey(KeyInputEvent event) {
116
        onInput(event.key(), event.action);
117
    }
118
119
    @EventHandler
120
    private void onButton(MouseClickEvent event) {
121
        onInput(event.button(), event.action);
122
    }
123
124
    private void onInput(int key, KeyAction action) {
125
        if (skip()) return;
126
127
        pass(mc.options.keyUp, key, action);
128
        pass(mc.options.keyDown, key, action);
129
        pass(mc.options.keyLeft, key, action);
130
        pass(mc.options.keyRight, key, action);
131
132
        if (jump.get()) pass(mc.options.keyJump, key, action);
133
        if (sneak.get()) pass(mc.options.keyShift, key, action);
134
        if (sprint.get()) pass(mc.options.keySprint, key, action);
135
    }
136
137
    @EventHandler
138
    private void onRender3D(Render3DEvent event) {
139
        if (skip()) return;
140
141
        float rotationDelta = Math.min((float) (rotateSpeed.get() * event.frameTime * 20f), 100);
142
143
        Freecam freecam = Modules.get().get(Freecam.class);
144
145
        if (arrowsRotate.get()) {
146
            if (!freecam.isActive()) {
147
                float yaw = mc.player.getYRot();
148
                float pitch = mc.player.getXRot();
149
150
                if (Input.isKeyPressed(KEY_LEFT)) yaw -= rotationDelta;
151
                if (Input.isKeyPressed(KEY_RIGHT)) yaw += rotationDelta;
152
                if (Input.isKeyPressed(KEY_UP)) pitch -= rotationDelta;
153
                if (Input.isKeyPressed(KEY_DOWN)) pitch += rotationDelta;
154
155
                pitch = Mth.clamp(pitch, -90, 90);
156
157
                mc.player.setYRot(yaw);
158
                mc.player.setXRot(pitch);
159
            } else {
160
                double dy = 0, dx = 0;
161
162
                if (Input.isKeyPressed(KEY_LEFT)) dy = -rotationDelta;
163
                if (Input.isKeyPressed(KEY_RIGHT)) dy = rotationDelta;
164
                if (Input.isKeyPressed(KEY_UP)) dx = -rotationDelta;
165
                if (Input.isKeyPressed(KEY_DOWN)) dx = rotationDelta;
166
167
                freecam.changeLookDirection(dy, dx);
168
            }
169
        }
170
    }
171
172
    private void pass(KeyMapping bind, int key, KeyAction action) {
173
        if (Input.getKey(bind) != key) return;
174
        if (action == KeyAction.Press) bind.setDown(true);
175
        if (action == KeyAction.Release) bind.setDown(false);
176
    }
177
178
    public boolean skip() {
179
        if (mc.gui.screen() == null ||
180
            (mc.gui.screen() instanceof CreativeModeInventoryScreen && CreativeModeInventoryScreenAccessor.meteor$getSelectedTab() == CreativeModeTabs.searchTab())
181
            || mc.gui.screen() instanceof ChatScreen
182
            || mc.gui.screen() instanceof SignEditScreen
183
            || mc.gui.screen() instanceof AnvilScreen
184
            || mc.gui.screen() instanceof AbstractCommandBlockEditScreen
185
            || mc.gui.screen() instanceof StructureBlockEditScreen) return true;
186
        if (screens.get() == Screens.GUI && !(mc.gui.screen() instanceof WidgetScreen)) return true;
187
        return screens.get() == Screens.Inventory && mc.gui.screen() instanceof WidgetScreen;
188
    }
189
}
190