long-jump module

long-jump: 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/LongJump.javaJava · 309 lines · 12.8 KB

Allows you to jump further than normal.

Settingsmodevanilla-boost-factorburst-initial-speedburst-boost-factoronly-on-groundon-jumpglide-multipliertimerauto-disabledisable-on-rubberband
LongJump.javaJava · Minecraft 26.2 · 309 lines · 12.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.entity.player.PlayerMoveEvent;
9
import meteordevelopment.meteorclient.events.packets.PacketEvent;
10
import meteordevelopment.meteorclient.events.world.TickEvent;
11
import meteordevelopment.meteorclient.mixininterface.IVec3;
12
import meteordevelopment.meteorclient.settings.*;
13
import meteordevelopment.meteorclient.systems.modules.Categories;
14
import meteordevelopment.meteorclient.systems.modules.Module;
15
import meteordevelopment.meteorclient.systems.modules.Modules;
16
import meteordevelopment.meteorclient.systems.modules.world.Timer;
17
import meteordevelopment.meteorclient.utils.Utils;
18
import meteordevelopment.meteorclient.utils.player.PlayerUtils;
19
import meteordevelopment.orbit.EventHandler;
20
import net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket;
21
import net.minecraft.world.effect.MobEffects;
22
23
public class LongJump extends Module {
24
    private final SettingGroup sgGeneral = settings.getDefaultGroup();
25
26
    public final Setting<JumpMode> jumpMode = sgGeneral.add(new EnumSetting.Builder<JumpMode>()
27
        .name("mode")
28
        .description("The method of jumping.")
29
        .defaultValue(JumpMode.Vanilla)
30
        .build()
31
    );
32
33
    private final Setting<Double> vanillaBoostFactor = sgGeneral.add(new DoubleSetting.Builder()
34
        .name("vanilla-boost-factor")
35
        .description("The amount by which to boost the jump.")
36
        .visible(() -> jumpMode.get() == JumpMode.Vanilla)
37
        .defaultValue(1.261)
38
        .min(0)
39
        .sliderMax(5)
40
        .build()
41
    );
42
43
    private final Setting<Double> burstInitialSpeed = sgGeneral.add(new DoubleSetting.Builder()
44
        .name("burst-initial-speed")
45
        .description("The initial speed of the runup.")
46
        .visible(() -> jumpMode.get() == JumpMode.Burst)
47
        .defaultValue(6)
48
        .min(0)
49
        .sliderMax(20)
50
        .build()
51
    );
52
53
    private final Setting<Double> burstBoostFactor = sgGeneral.add(new DoubleSetting.Builder()
54
        .name("burst-boost-factor")
55
        .description("The amount by which to boost the jump.")
56
        .visible(() -> jumpMode.get() == JumpMode.Burst)
57
        .defaultValue(2.149)
58
        .min(0)
59
        .sliderMax(20)
60
        .build()
61
    );
62
63
    private final Setting<Boolean> onlyOnGround = sgGeneral.add(new BoolSetting.Builder()
64
        .name("only-on-ground")
65
        .description("Only performs the jump if you are on the ground.")
66
        .visible(() -> jumpMode.get() == JumpMode.Burst)
67
        .defaultValue(true)
68
        .build()
69
    );
70
71
    private final Setting<Boolean> onJump = sgGeneral.add(new BoolSetting.Builder()
72
        .name("on-jump")
73
        .description("Whether the player needs to jump first or not.")
74
        .visible(() -> jumpMode.get() == JumpMode.Burst)
75
        .defaultValue(false)
76
        .build()
77
    );
78
79
    private final Setting<Double> glideMultiplier = sgGeneral.add(new DoubleSetting.Builder()
80
        .name("glide-multiplier")
81
        .description("The amount by to multiply the glide velocity.")
82
        .visible(() -> jumpMode.get() == JumpMode.Glide)
83
        .defaultValue(1)
84
        .min(0)
85
        .sliderMax(5)
86
        .build()
87
    );
88
89
    public final Setting<Double> timer = sgGeneral.add(new DoubleSetting.Builder()
90
        .name("timer")
91
        .description("Timer override.")
92
        .defaultValue(1)
93
        .min(0.01)
94
        .sliderMin(0.01)
95
        .build()
96
    );
97
98
    private final Setting<Boolean> autoDisable = sgGeneral.add(new BoolSetting.Builder()
99
        .name("auto-disable")
100
        .description("Automatically disabled the module after jumping.")
101
        .visible(() -> jumpMode.get() != JumpMode.Vanilla)
102
        .defaultValue(true)
103
        .build()
104
    );
105
106
    private final Setting<Boolean> disableOnRubberband = sgGeneral.add(new BoolSetting.Builder()
107
        .name("disable-on-rubberband")
108
        .description("Disables the module when you get lagged back.")
109
        .defaultValue(true)
110
        .build()
111
    );
112
113
    public LongJump() {
114
        super(Categories.Movement, "long-jump", "Allows you to jump further than normal.");
115
    }
116
117
    private int stage;
118
    private double moveSpeed;
119
    private boolean jumping = false;
120
    private int airTicks;
121
    private int groundTicks;
122
    private boolean jumped = false;
123
124
    @Override
125
    public void onActivate() {
126
        stage = 0;
127
        jumping = false;
128
        airTicks = 0;
129
        groundTicks = -5;
130
    }
131
132
    @Override
133
    public void onDeactivate() {
134
        Modules.get().get(Timer.class).setOverride(Timer.OFF);
135
    }
136
137
    @EventHandler
138
    private void onPacketReceive(PacketEvent.Receive event) {
139
        if (event.packet instanceof ClientboundPlayerPositionPacket && disableOnRubberband.get()) {
140
            info("Rubberband detected! Disabling...");
141
            toggle();
142
        }
143
    }
144
145
    @EventHandler
146
    private void onPlayerMove(PlayerMoveEvent event) {
147
        if (timer.get() != Timer.OFF) {
148
            Modules.get().get(Timer.class).setOverride(PlayerUtils.isMoving() ? timer.get() : Timer.OFF);
149
        }
150
        switch (jumpMode.get()) {
151
            case Vanilla -> {
152
                if (PlayerUtils.isMoving() && mc.options.keyJump.isDown()) {
153
                    double dir = getDir();
154
155
                    double xDir = Math.cos(Math.toRadians(dir + 90));
156
                    double zDir = Math.sin(Math.toRadians(dir + 90));
157
158
                    if (!mc.level.noCollision(mc.player.getBoundingBox().move(0.0, mc.player.getDeltaMovement().y, 0.0)) || mc.player.verticalCollision) {
159
                        ((IVec3) event.movement).meteor$setXZ(xDir * 0.29F, zDir * 0.29F);
160
                    }
161
                    if ((event.movement.y() == .33319999363422365)) {
162
                        ((IVec3) event.movement).meteor$setXZ(xDir * vanillaBoostFactor.get(), zDir * vanillaBoostFactor.get());
163
                    }
164
                }
165
            }
166
            case Burst -> {
167
                if (stage != 0 && !mc.player.onGround() && autoDisable.get()) jumping = true;
168
                if (jumping && (mc.player.getY() - (int) mc.player.getY() < 0.01)) {
169
                    jumping = false;
170
                    toggle();
171
                    info("Disabling after jump.");
172
                }
173
174
                if (onlyOnGround.get() && !mc.player.onGround() && stage == 0) return;
175
176
                double xDist = mc.player.getX() - mc.player.xo;
177
                double zDist = mc.player.getZ() - mc.player.zo;
178
                double lastDist = Math.sqrt((xDist * xDist) + (zDist * zDist));
179
180
                if (PlayerUtils.isMoving() && (!onJump.get() || mc.options.keyJump.isDown()) && !mc.player.isInLava() && !mc.player.isInWater()) {
181
                    switch (stage) {
182
                        case 0 -> moveSpeed = getMoveSpeed() * burstInitialSpeed.get();
183
                        case 1 -> {
184
                            ((IVec3) event.movement).meteor$setY(0.42);
185
                            moveSpeed *= burstBoostFactor.get();
186
                        }
187
                        case 2 -> {
188
                            final double difference = lastDist - getMoveSpeed();
189
                            moveSpeed = lastDist - difference;
190
                        }
191
                        default -> moveSpeed = lastDist - lastDist / 159;
192
                    }
193
194
                    setMoveSpeed(event, moveSpeed = Math.max(getMoveSpeed(), moveSpeed));
195
                    if (!mc.player.verticalCollision && !mc.level.noCollision(mc.player.getBoundingBox().move(0.0, mc.player.getDeltaMovement().y, 0.0)) && !mc.level.noCollision(mc.player.getBoundingBox().move(0.0, -0.4, 0.0))) {
196
                        ((IVec3) event.movement).meteor$setY(-0.001);
197
                    }
198
199
                    stage++;
200
                }
201
            }
202
        }
203
    }
204
205
    @EventHandler
206
    private void onTick(TickEvent.Pre event) {
207
        if (Utils.canUpdate() && jumpMode.get() == JumpMode.Glide) {
208
            if (!PlayerUtils.isMoving()) return;
209
210
            float yaw = mc.player.getYRot() + 90;
211
            double forward = ((mc.player.zza != 0) ? ((mc.player.zza > 0) ? 1 : -1) : 0);
212
            float[] motion = {0.4206065F, 0.4179245F, 0.41525924F, 0.41261F, 0.409978F, 0.407361F, 0.404761F, 0.402178F, 0.399611F, 0.39706F, 0.394525F, 0.392F, 0.3894F, 0.38644F, 0.383655F, 0.381105F, 0.37867F, 0.37625F, 0.37384F, 0.37145F, 0.369F, 0.3666F, 0.3642F, 0.3618F, 0.35945F, 0.357F, 0.354F, 0.351F, 0.348F, 0.345F, 0.342F, 0.339F, 0.336F, 0.333F, 0.33F, 0.327F, 0.324F, 0.321F, 0.318F, 0.315F, 0.312F, 0.309F, 0.307F, 0.305F, 0.303F, 0.3F, 0.297F, 0.295F, 0.293F, 0.291F, 0.289F, 0.287F, 0.285F, 0.283F, 0.281F, 0.279F, 0.277F, 0.275F, 0.273F, 0.271F, 0.269F, 0.267F, 0.265F, 0.263F, 0.261F, 0.259F, 0.257F, 0.255F, 0.253F, 0.251F, 0.249F, 0.247F, 0.245F, 0.243F, 0.241F, 0.239F, 0.237F};
213
            float[] glide = {0.3425F, 0.5445F, 0.65425F, 0.685F, 0.675F, 0.2F, 0.895F, 0.719F, 0.76F};
214
215
            final double cos = Math.cos(Math.toRadians(yaw));
216
            final double sin = Math.sin(Math.toRadians(yaw));
217
218
            if (!mc.player.verticalCollision && !mc.player.onGround()) {
219
                jumped = true;
220
                airTicks += 1;
221
                groundTicks = -5;
222
223
                double velocityY = mc.player.getDeltaMovement().y;
224
225
                if (airTicks - 6 >= 0 && airTicks - 6 < glide.length)
226
                    updateY(velocityY * glide[(airTicks - 6)] * glideMultiplier.get());
227
228
                if (velocityY < -0.2 && velocityY > -0.24) updateY(velocityY * 0.7 * glideMultiplier.get());
229
                else if (velocityY < -0.25 && velocityY > -0.32) updateY(velocityY * 0.8 * glideMultiplier.get());
230
                else if (velocityY < -0.35 && velocityY > -0.8) updateY(velocityY * 0.98 * glideMultiplier.get());
231
232
                if (airTicks - 1 >= 0 && airTicks - 1 < motion.length) {
233
                    mc.player.setDeltaMovement((forward * motion[(airTicks - 1)] * 3 * cos) * glideMultiplier.get(), mc.player.getDeltaMovement().y, (forward * motion[(airTicks - 1)] * 3 * sin) * glideMultiplier.get());
234
                } else {
235
                    mc.player.setDeltaMovement(0, mc.player.getDeltaMovement().y, 0);
236
                }
237
            } else {
238
                if (autoDisable.get() && jumped) {
239
                    jumped = false;
240
                    toggle();
241
                    info("Disabling after jump.");
242
                }
243
                airTicks = 0;
244
                groundTicks += 1;
245
                if (groundTicks <= 2) {
246
                    mc.player.setDeltaMovement(forward * 0.009999999776482582 * cos * glideMultiplier.get(), mc.player.getDeltaMovement().y, forward * 0.009999999776482582 * sin * glideMultiplier.get());
247
                } else {
248
                    mc.player.setDeltaMovement(forward * 0.30000001192092896 * cos * glideMultiplier.get(), 0.42399999499320984, forward * 0.30000001192092896 * sin * glideMultiplier.get());
249
                }
250
            }
251
        }
252
    }
253
254
    private void updateY(double amount) {
255
        mc.player.setDeltaMovement(mc.player.getDeltaMovement().x, amount, mc.player.getDeltaMovement().z);
256
    }
257
258
    private double getDir() {
259
        double dir = 0;
260
261
        if (Utils.canUpdate()) {
262
            dir = mc.player.getYRot() + ((mc.player.zza < 0) ? 180 : 0);
263
264
            if (mc.player.xxa > 0) {
265
                dir += -90F * ((mc.player.zza < 0) ? -0.5F : ((mc.player.zza > 0) ? 0.5F : 1F));
266
            } else if (mc.player.xxa < 0) {
267
                dir += 90F * ((mc.player.zza < 0) ? -0.5F : ((mc.player.zza > 0) ? 0.5F : 1F));
268
            }
269
        }
270
        return dir;
271
    }
272
273
    private double getMoveSpeed() {
274
        double base = 0.2873;
275
        if (mc.player.hasEffect(MobEffects.SPEED)) {
276
            base *= 1.0 + 0.2 * (mc.player.getEffect(MobEffects.SPEED).getAmplifier() + 1);
277
        }
278
        return base;
279
    }
280
281
    private void setMoveSpeed(PlayerMoveEvent event, double speed) {
282
        double forward = mc.player.zza;
283
        double strafe = mc.player.xxa;
284
        float yaw = mc.player.getYRot();
285
286
        if (!PlayerUtils.isMoving()) {
287
            ((IVec3) event.movement).meteor$setXZ(0, 0);
288
        } else {
289
            if (forward != 0) {
290
                if (strafe > 0) yaw += ((forward > 0) ? -45 : 45);
291
                else if (strafe < 0) yaw += ((forward > 0) ? 45 : -45);
292
            }
293
            strafe = 0;
294
            if (forward > 0) forward = 1;
295
            else if (forward < 0) forward = -1;
296
        }
297
298
        double cos = Math.cos(Math.toRadians(yaw + 90));
299
        double sin = Math.sin(Math.toRadians(yaw + 90));
300
        ((IVec3) event.movement).meteor$setXZ((forward * speed * cos) + (strafe * speed * sin), (forward * speed * sin) + (strafe * speed * cos));
301
    }
302
303
    public enum JumpMode {
304
        Vanilla,
305
        Burst,
306
        Glide
307
    }
308
}
309