LongJump module

LongJump: Minecraft 26.3 cheat module, full source for every implementation (3 clients: MelaHack (ThunderHack fork), OfflineClient, LiquidBounce (Kotlin)).

3 implementationsMOVEMENT

Full module source: 3 implementations

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

MelaHack (ThunderHack fork)MOVEMENTsrc/main/java/thunder/hack/features/modules/movement/LongJump.javaJava · 111 lines · 4.2 KB

Allows you to jump higher and further.

SettingsTimerJumpDisableTimerSpeedSpeedMaxDistance
LongJump.javaJava · Minecraft 26.2 · 111 lines · 4.2 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.features.modules.movement;
2
3
import meteordevelopment.orbit.EventHandler;
4
import net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket;
5
import net.minecraft.world.effect.MobEffects;
6
import net.minecraft.world.phys.Vec3;
7
import thunder.hack.ThunderHack;
8
import thunder.hack.events.impl.EventMove;
9
import thunder.hack.events.impl.EventSync;
10
import thunder.hack.events.impl.PacketEvent;
11
import thunder.hack.features.modules.Module;
12
import thunder.hack.setting.Setting;
13
import thunder.hack.utility.player.MovementUtility;
14
15
import static thunder.hack.features.modules.client.ClientSettings.isRu;
16
17
public class LongJump extends Module {
18
    public LongJump() {
19
        super("LongJump", Category.MOVEMENT);
20
    }
21
22
    private final Setting<Boolean> useTimer = new Setting<>("Timer", false);
23
    private final Setting<Boolean> jumpDisable = new Setting<>("JumpDisable", true);
24
    private final Setting<Float> timerValue = new Setting<>("TimerSpeed", 1.0F, 0.5F, 3.0F, v -> useTimer.getValue());
25
    private final Setting<Float> speed = new Setting<>("Speed", 1.35F, 0.1F, 10.0F);
26
    private final Setting<Float> maxDistance = new Setting<>("MaxDistance", 10f, 5f, 40f);
27
28
    private float plannedSpeed, realSpeed;
29
    private int stage = 0;
30
    private Vec3 prevPosition;
31
32
    @EventHandler
33
    public void onMove(EventMove e) {
34
        if (prevPosition != null && mc.player.position().distanceToSqr(prevPosition) > maxDistance.getPow2Value())
35
            disable(isRu() ? "Прыжок выполнен! Отключаю.." : "Jump complete! Disabling..");
36
37
        if (MovementUtility.isMoving()) {
38
            if (useTimer.getValue())
39
                ThunderHack.TICK_TIMER = timerValue.getValue();
40
41
            switch (stage) {
42
                case 0 -> {
43
                    plannedSpeed = (float) (speed.getValue() * MovementUtility.getBaseMoveSpeed());
44
                    realSpeed = 0f;
45
                    ++stage;
46
                }
47
                case 1 -> {
48
                    mc.player.setDeltaMovement(mc.player.getDeltaMovement().x(), 0.42 + isJumpBoost(), mc.player.getDeltaMovement().z());
49
                    e.setY(0.42 + isJumpBoost());
50
                    plannedSpeed *= 2.149f;
51
                    ++stage;
52
                }
53
                case 2 -> {
54
                    double d = 0.66f * (realSpeed - MovementUtility.getBaseMoveSpeed());
55
                    plannedSpeed = (float) (realSpeed - d);
56
                    ++stage;
57
                }
58
                case 3 -> {
59
                    if (mc.player.verticalCollision || mc.level.getBlockCollisions(mc.player, mc.player.getBoundingBox().inflate(-0.2, 0.0, -0.2).move(0.0, mc.player.getDeltaMovement().y(), 0.0)).iterator().hasNext()) {
60
                        if (jumpDisable.getValue())
61
                            disable(isRu() ? "Прыжок выполнен! Отключаю.." : "Jump complete! Disabling..");
62
                        stage = 0;
63
                        realSpeed = 0f;
64
                    }
65
                    plannedSpeed = realSpeed - realSpeed / 159f;
66
                }
67
            }
68
        }
69
        plannedSpeed = (float) Math.max(MovementUtility.getBaseMoveSpeed(), plannedSpeed);
70
71
        MovementUtility.modifyEventSpeed(e, plannedSpeed);
72
        e.cancel();
73
    }
74
75
    @EventHandler
76
    public void onPacketReceive(PacketEvent.Receive e) {
77
        if (e.getPacket() instanceof ClientboundPlayerPositionPacket)
78
            disable(isRu() ? "Тебя флагнуло! Отключаю.." : "You've been flagged! Disabling..");
79
    }
80
81
    @Override
82
    public void onDisable() {
83
        resetValues();
84
    }
85
86
    @Override
87
    public void onEnable() {
88
        resetValues();
89
    }
90
91
    public void resetValues() {
92
        prevPosition = mc.player.position();
93
        ThunderHack.TICK_TIMER = 1f;
94
        plannedSpeed = 0;
95
        realSpeed = 0;
96
        stage = 0;
97
    }
98
99
    public float isJumpBoost() {
100
        if (mc.player.hasEffect(MobEffects.JUMP_BOOST)) return 0.2f;
101
        else return 0f;
102
    }
103
104
    @EventHandler
105
    public void onEntitySync(EventSync eventSync) {
106
        if (MovementUtility.isMoving())
107
            realSpeed = (float) Math.hypot(mc.player.getX() - mc.player.xo, mc.player.getZ() - mc.player.zo);
108
        else resetValues();
109
    }
110
}
111
OfflineClientMOVEMENTsrc/main/java/com/jellypudding/offlineclient/modules/movement/LongJump.javaJava · 270 lines · 10.9 KB

Jump much further than normal.

SettingsModeMultiplierBurst start speedBurst boostOnly on groundOn jumpGlide multiplierTimerAuto disableStop on lagback
LongJump.javaJava · Minecraft 26.2 · 270 lines · 10.9 KB · complete file, verbatimOriginal ↗
1
package com.jellypudding.offlineclient.modules.movement;
2
3
import com.jellypudding.offlineclient.event.Subscribe;
4
import com.jellypudding.offlineclient.event.events.PacketReceiveEvent;
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.modules.misc.Timer;
9
import com.jellypudding.offlineclient.setting.BoolSetting;
10
import com.jellypudding.offlineclient.setting.EnumSetting;
11
import com.jellypudding.offlineclient.setting.NumberSetting;
12
import com.jellypudding.offlineclient.util.ChatUtil;
13
import com.jellypudding.offlineclient.util.JumpCarry;
14
import com.jellypudding.offlineclient.util.MovementUtil;
15
import net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket;
16
import net.minecraft.world.effect.MobEffectInstance;
17
import net.minecraft.world.effect.MobEffects;
18
import net.minecraft.world.phys.Vec3;
19
20
// Vanilla carries a real jump further. Burst and Glide are staged speed
21
// exploits from older servers and a modern movement check pulls them back.
22
public final class LongJump extends Module {
23
24
    public enum Mode { VANILLA, BURST, GLIDE }
25
26
    // Average horizontal speed per tick of a normal sprint jump.
27
    private static final double BASE_SPEED = 0.35;
28
29
    private static final String TIMER_KEY = "longjump";
30
31
    // Walking pace on flat ground and the boost each Speed level adds to it.
32
    private static final double WALK_SPEED = 0.2873;
33
    private static final double SPEED_EFFECT_STEP = 0.2;
34
35
    // Burst lifts with a vanilla jump then bleeds a sliver of speed a tick.
36
    private static final double BURST_JUMP = 0.42;
37
    private static final double BURST_DECAY = 1.0 / 159;
38
    private static final double HOVER_PIN = -0.001;
39
    private static final double HOVER_REACH = 0.4;
40
    private static final double LANDED_FRACTION = 0.01;
41
42
    // Glide pace starts here and falls off each tick in the air to a floor.
43
    private static final double GLIDE_START = 0.4206;
44
    private static final double GLIDE_FALL_OFF = 0.0024;
45
    private static final double GLIDE_FLOOR = 0.237;
46
    private static final double GLIDE_PUSH = 3;
47
    // Ticks in the air before the descent is softened and for how long.
48
    private static final int GLIDE_SOFTEN_FROM = 6;
49
    private static final int GLIDE_SOFTEN_TICKS = 9;
50
    private static final double GLIDE_SOFTEN = 0.65;
51
    // Two ticks of a small step off the ground then a re jump.
52
    private static final int GLIDE_GROUND_TICKS = 2;
53
    private static final double GLIDE_STEP = 0.01;
54
    private static final double GLIDE_REJUMP_PUSH = 0.3;
55
    private static final double GLIDE_REJUMP = 0.424;
56
57
    private final EnumSetting<Mode> mode = new EnumSetting<>("Mode",
58
        "How the jump is stretched.", Mode.VANILLA)
59
        .describe(Mode.VANILLA, "A real jump carries you further along.")
60
        .describe(Mode.BURST, "A short run up then one huge hop. An old exploit that most servers pull back.")
61
        .describe(Mode.GLIDE, "Hops and glides along on a fixed speed curve. An old exploit that most servers pull back.");
62
    private final NumberSetting multiplier = new NumberSetting("Multiplier",
63
        "How much further a jump carries you.",
64
        3, 1, 10, 0.5, "x").min(0.1)
65
        .under(mode, Mode.VANILLA);
66
    private final NumberSetting burstStart = new NumberSetting("Burst start speed",
67
        "How many times walking pace the run up starts at.", 6, 0, 20, 0.5, "x").min(0)
68
        .under(mode, Mode.BURST);
69
    private final NumberSetting burstBoost = new NumberSetting("Burst boost",
70
        "How much the hop multiplies the run up speed by.", 2.149, 0, 20, 0.05, "x").min(0)
71
        .under(mode, Mode.BURST);
72
    private final BoolSetting onlyOnGround = new BoolSetting("Only on ground",
73
        "The burst only starts whilst you stand on the ground.", true)
74
        .under(mode, Mode.BURST);
75
    private final BoolSetting onJump = new BoolSetting("On jump",
76
        "Waits for the jump key instead of bursting as soon as you move.", false)
77
        .under(mode, Mode.BURST);
78
    private final NumberSetting glideMultiplier = new NumberSetting("Glide multiplier",
79
        "Scales every speed of the glide curve.", 1, 0, 5, 0.1, "x").min(0)
80
        .under(mode, Mode.GLIDE);
81
    private final NumberSetting timer = new NumberSetting("Timer",
82
        "Also speeds up the game whilst you move. 1 does nothing.", 1, 1, 3, 0.1, "x").min(1);
83
    private final BoolSetting autoDisable = new BoolSetting("Auto disable",
84
        "Turns the module off once you land after the jump.", true)
85
        .under(mode, Mode.BURST, Mode.GLIDE);
86
    private final BoolSetting stopOnLagback = new BoolSetting("Stop on lagback",
87
        "Ends the boost when the server teleports you back.", true);
88
89
    private final JumpCarry carry = new JumpCarry();
90
91
    // Burst stage and the speed it holds.
92
    private int stage;
93
    private double burstSpeed;
94
    private boolean airborne;
95
96
    // Glide ticks in the air and on the ground.
97
    private int airTicks;
98
    private int groundTicks;
99
100
    public LongJump() {
101
        super("LongJump", "Jump much further than normal.", Category.MOVEMENT);
102
        addSettings(mode, multiplier, burstStart, burstBoost, onlyOnGround, onJump,
103
            glideMultiplier, timer, autoDisable, stopOnLagback);
104
    }
105
106
    @Override
107
    public String getSuffix() {
108
        return mode.is(Mode.VANILLA) ? multiplier.getValueString() : mode.getValueString();
109
    }
110
111
    @Override
112
    protected void onEnable() {
113
        carry.stop();
114
        stage = 0;
115
        burstSpeed = 0;
116
        airborne = false;
117
        airTicks = 0;
118
        groundTicks = -GLIDE_GROUND_TICKS;
119
    }
120
121
    @Override
122
    protected void onDisable() {
123
        Timer.override(TIMER_KEY, 1f);
124
    }
125
126
    // Called from LocalPlayerMixin once the game has set the jump velocity.
127
    public void onJump() {
128
        if (!isEnabled() || !mode.is(Mode.VANILLA) || !inGame()
129
            || !JumpCarry.inPlainAir(mc.player)) {
130
            return;
131
        }
132
        carry.start(BASE_SPEED * multiplier.getValue());
133
    }
134
135
    @Subscribe
136
    private void onTick(TickEvent event) {
137
        if (!inGame()) {
138
            return;
139
        }
140
        boolean moving = MovementUtil.inputDirection().lengthSqr() > 0;
141
        Timer.override(TIMER_KEY, moving ? timer.getFloat() : 1f);
142
        switch (mode.getValue()) {
143
            case VANILLA -> carry.tick();
144
            case BURST -> burstTick(moving);
145
            case GLIDE -> glideTick(moving);
146
        }
147
    }
148
149
    // Stage 0 sets off at a run. Stage 1 hops and multiplies the speed.
150
    // Every stage after lets a sliver go. The server sees a slowing player.
151
    private void burstTick(boolean moving) {
152
        if (stage != 0 && !mc.player.onGround() && autoDisable.isOn()) {
153
            airborne = true;
154
        }
155
        if (airborne && mc.player.getY() - Math.floor(mc.player.getY()) < LANDED_FRACTION) {
156
            disableAfterJump();
157
            return;
158
        }
159
        if (onlyOnGround.isOn() && !mc.player.onGround() && stage == 0) {
160
            return;
161
        }
162
        if (!moving || (onJump.isOn() && !mc.options.keyJump.isDown())
163
            || mc.player.isInLava() || mc.player.isInWater()) {
164
            return;
165
        }
166
        double lastDistance = Math.hypot(mc.player.getX() - mc.player.xo,
167
            mc.player.getZ() - mc.player.zo);
168
        Vec3 velocity = mc.player.getDeltaMovement();
169
        double vy = velocity.y;
170
        switch (stage) {
171
            case 0 -> burstSpeed = walkSpeed() * burstStart.getValue();
172
            case 1 -> {
173
                vy = BURST_JUMP;
174
                burstSpeed *= burstBoost.getValue();
175
            }
176
            case 2 -> burstSpeed = walkSpeed();
177
            default -> burstSpeed = lastDistance - lastDistance * BURST_DECAY;
178
        }
179
        burstSpeed = Math.max(walkSpeed(), burstSpeed);
180
        Vec3 heading = MovementUtil.inputDirection().scale(burstSpeed);
181
        // Hanging just above a block is pinned down onto it.
182
        if (!mc.player.verticalCollision && !fits(vy) && !fits(-HOVER_REACH)) {
183
            vy = HOVER_PIN;
184
        }
185
        mc.player.setDeltaMovement(heading.x, vy, heading.z);
186
        stage++;
187
    }
188
189
    private boolean fits(double dy) {
190
        return mc.level.noCollision(mc.player, mc.player.getBoundingBox().move(0, dy, 0));
191
    }
192
193
    // Walking pace with the Speed effect counted in.
194
    private double walkSpeed() {
195
        MobEffectInstance speed = mc.player.getEffect(MobEffects.SPEED);
196
        if (speed == null) {
197
            return WALK_SPEED;
198
        }
199
        return WALK_SPEED * (1 + SPEED_EFFECT_STEP * (speed.getAmplifier() + 1));
200
    }
201
202
    // In the air the pace follows a falling curve and the descent is softened.
203
    // On the ground two small steps lead into a fresh hop.
204
    private void glideTick(boolean moving) {
205
        if (!moving) {
206
            return;
207
        }
208
        double scale = glideMultiplier.getValue();
209
        Vec3 heading = MovementUtil.inputDirection();
210
        Vec3 velocity = mc.player.getDeltaMovement();
211
        if (!mc.player.verticalCollision && !mc.player.onGround()) {
212
            airborne = true;
213
            airTicks++;
214
            groundTicks = -GLIDE_GROUND_TICKS;
215
            double vy = softenedDescent(velocity.y) * scale;
216
            double pace = Math.max(GLIDE_FLOOR, GLIDE_START - GLIDE_FALL_OFF * (airTicks - 1))
217
                * GLIDE_PUSH * scale;
218
            mc.player.setDeltaMovement(heading.x * pace, vy, heading.z * pace);
219
            return;
220
        }
221
        if (autoDisable.isOn() && airborne) {
222
            disableAfterJump();
223
            return;
224
        }
225
        airTicks = 0;
226
        groundTicks++;
227
        if (groundTicks <= GLIDE_GROUND_TICKS) {
228
            double pace = GLIDE_STEP * scale;
229
            mc.player.setDeltaMovement(heading.x * pace, velocity.y, heading.z * pace);
230
        } else {
231
            double pace = GLIDE_REJUMP_PUSH * scale;
232
            mc.player.setDeltaMovement(heading.x * pace, GLIDE_REJUMP, heading.z * pace);
233
        }
234
    }
235
236
    // The fall is held back hardest for a few ticks after the peak of the hop
237
    // and a little at every speed a real fall passes through.
238
    private double softenedDescent(double vy) {
239
        int sinceSoften = airTicks - GLIDE_SOFTEN_FROM;
240
        if (sinceSoften >= 0 && sinceSoften < GLIDE_SOFTEN_TICKS) {
241
            vy *= GLIDE_SOFTEN;
242
        }
243
        if (vy < -0.2 && vy > -0.24) {
244
            return vy * 0.7;
245
        }
246
        if (vy < -0.25 && vy > -0.32) {
247
            return vy * 0.8;
248
        }
249
        if (vy < -0.35 && vy > -0.8) {
250
            return vy * 0.98;
251
        }
252
        return vy;
253
    }
254
255
    private void disableAfterJump() {
256
        airborne = false;
257
        setEnabled(false);
258
        ChatUtil.message("LongJump turned off after the jump.");
259
    }
260
261
    @Subscribe
262
    private void onPacketReceive(PacketReceiveEvent event) {
263
        if (stopOnLagback.isOn() && event.getPacket() instanceof ClientboundPlayerPositionPacket) {
264
            carry.stop();
265
            stage = 0;
266
            airTicks = 0;
267
        }
268
    }
269
}
270
LiquidBounce (Kotlin)MOVEMENTsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/movement/longjump/ModuleLongJump.ktKotlin · 75 lines · 2.7 KB

Allows you to jump further.

SettingsAutoJumpDisableAfterFinished
ModuleLongJump.ktKotlin · Minecraft 26.2 · 75 lines · 2.7 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.movement.longjump
20
21
import net.ccbluex.liquidbounce.event.events.MovementInputEvent
22
import net.ccbluex.liquidbounce.event.events.PlayerJumpEvent
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.features.module.modules.movement.longjump.modes.Matrix7145FlagLongJump
27
import net.ccbluex.liquidbounce.features.module.modules.movement.longjump.modes.VulcanLongJump
28
import net.ccbluex.liquidbounce.features.module.modules.movement.longjump.modes.nocheatplus.NoCheatPlusBoost
29
import net.ccbluex.liquidbounce.features.module.modules.movement.longjump.modes.nocheatplus.NoCheatPlusBow
30
import net.ccbluex.liquidbounce.utils.entity.moving
31
32
object ModuleLongJump : ClientModule("LongJump", ModuleCategories.MOVEMENT) {
33
34
    val mode = choices(
35
        "Mode", NoCheatPlusBoost, arrayOf(
36
            // NoCheatPlus
37
            NoCheatPlusBoost,
38
            NoCheatPlusBow,
39
            VulcanLongJump,
40
            Matrix7145FlagLongJump
41
        )
42
    ).apply { tagBy(this) }
43
    private val autoJump by boolean("AutoJump", false)
44
    val autoDisable by boolean("DisableAfterFinished", false)
45
46
    var jumped = false
47
    var canBoost = false
48
    var boosted = false
49
50
    val tickHandler = handler<MovementInputEvent> {
51
        if (jumped) {
52
            if (player.onGround() || player.abilities.flying) {
53
                if (autoDisable && boosted) {
54
                    enabled = false
55
                }
56
57
                jumped = false
58
            }
59
        }
60
61
        // AutoJump
62
        if (autoJump && player.onGround() && player.moving
63
            && mode.activeMode != NoCheatPlusBow) {
64
            player.jumpFromGround()
65
            jumped = true
66
        }
67
    }
68
69
    @Suppress("unused")
70
    val manualJumpHandler = handler<PlayerJumpEvent> {
71
        jumped = true
72
        canBoost = true
73
    }
74
}
75