Glide module

Glide: Minecraft 26.3 cheat module, full source for every implementation (1 client: OfflineClient).

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.

OfflineClientMOVEMENTsrc/main/java/com/jellypudding/offlineclient/modules/movement/Glide.javaJava · 111 lines · 3.9 KB

Slows your fall into a controlled drift.

SettingsFall speedHorizontal boostMinimum heightPause whilst sneaking
Glide.javaJava · Minecraft 26.2 · 111 lines · 3.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.AirStrafingSpeedEvent;
5
import com.jellypudding.offlineclient.event.events.TickEvent;
6
import com.jellypudding.offlineclient.module.Category;
7
import com.jellypudding.offlineclient.module.ExclusivityGroup;
8
import com.jellypudding.offlineclient.module.Module;
9
import com.jellypudding.offlineclient.setting.BoolSetting;
10
import com.jellypudding.offlineclient.setting.NumberSetting;
11
import com.jellypudding.offlineclient.util.BlockUtil;
12
import net.minecraft.core.BlockPos;
13
import net.minecraft.world.phys.AABB;
14
import net.minecraft.world.phys.Vec3;
15
16
public final class Glide extends Module {
17
18
    private final NumberSetting fallSpeed = new NumberSetting("Fall speed",
19
        "Blocks you drop per tick whilst gliding.", 0.125, 0.005, 0.3, 0.005);
20
    private final NumberSetting boost = new NumberSetting("Horizontal boost",
21
        "How much further your keys carry you through the air.", 1.2, 1, 3, 0.05, "x");
22
    private final NumberSetting minHeight = new NumberSetting("Minimum height",
23
        "Stops gliding once the ground is this close with zero turning it off.",
24
        0, 0, 4, 0.25, " blocks");
25
    private final BoolSetting pauseOnSneak = new BoolSetting("Pause whilst sneaking",
26
        "Holding sneak drops you at the normal speed.", true);
27
28
    // Read by the air strafing hook later in the same tick.
29
    private boolean gliding;
30
31
    public Glide() {
32
        super("Glide", "Slows your fall into a controlled drift.", Category.MOVEMENT);
33
        addSettings(fallSpeed, boost, minHeight, pauseOnSneak);
34
        searchTags("slow fall", "float", "parachute", "feather falling");
35
    }
36
37
    @Override
38
    public String getSuffix() {
39
        if (pauseOnSneak.isOn() && inGame() && mc.player.isShiftKeyDown()) {
40
            return "paused";
41
        }
42
        return fallSpeed.getValueString();
43
    }
44
45
    @Override
46
    public ExclusivityGroup getExclusivityGroup() {
47
        return ExclusivityGroup.FALL_CONTROL;
48
    }
49
50
    @Override
51
    protected void onEnable() {
52
        gliding = false;
53
    }
54
55
    @Override
56
    protected void onDisable() {
57
        gliding = false;
58
    }
59
60
    @Subscribe
61
    private void onTick(TickEvent event) {
62
        gliding = false;
63
        if (!inGame() || mc.player.isSpectator() || mc.player.isPassenger()) {
64
            return;
65
        }
66
        if (pauseOnSneak.isOn() && mc.player.isShiftKeyDown()) {
67
            return;
68
        }
69
        if (mc.player.onGround() || mc.player.isFallFlying() || mc.player.getAbilities().flying
70
            || mc.player.isInWater() || mc.player.isInLava() || mc.player.onClimbable()) {
71
            return;
72
        }
73
        Vec3 velocity = mc.player.getDeltaMovement();
74
        if (velocity.y >= 0 || groundIsNear()) {
75
            return;
76
        }
77
78
        gliding = true;
79
        // Vanilla takes gravity off this value again before it moves the player.
80
        double target = mc.player.getGravity() - fallSpeed.getValue();
81
        mc.player.setDeltaMovement(velocity.x, Math.max(velocity.y, target), velocity.z);
82
    }
83
84
    @Subscribe
85
    private void onAirStrafingSpeed(AirStrafingSpeedEvent event) {
86
        if (gliding) {
87
            event.setSpeed(event.getSpeed() * boost.getFloat());
88
        }
89
    }
90
91
    // True when there is anything to land on within the minimum height.
92
    // Fluids are checked by hand because they carry no collision shape.
93
    private boolean groundIsNear() {
94
        double reach = minHeight.getValue();
95
        if (reach <= 0) {
96
            return false;
97
        }
98
        AABB box = mc.player.getBoundingBox();
99
        AABB swept = box.minmax(box.move(0, -reach, 0));
100
        if (!mc.level.noCollision(mc.player, swept)) {
101
            return true;
102
        }
103
        for (BlockPos pos : BlockPos.betweenClosed(swept)) {
104
            if (!BlockUtil.state(pos).getFluidState().isEmpty()) {
105
                return true;
106
            }
107
        }
108
        return false;
109
    }
110
}
111