NoSlowdown module

NoSlowdown: 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/NoSlowdown.javaJava · 166 lines · 6.4 KB

Keeps your full speed through everything that would normally slow you down.

SettingsItemsAir strictSneakingHungerSlownessHoney blocksSoul sandSlime blocksBerry bushesCobwebsWeb timerFluid drag
NoSlowdown.javaJava · Minecraft 26.2 · 166 lines · 6.4 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.PacketSendEvent;
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.InputUtil;
13
import net.minecraft.world.level.block.Block;
14
import net.minecraft.world.level.block.Blocks;
15
16
// Each slowdown source has its own mixin hook across several classes.
17
// Vanilla slows slime twice through step and friction. Both are covered here.
18
public final class NoSlowdown extends Module {
19
20
    public enum WebMode { FULL_SPEED, TIMER, OFF }
21
22
    // Slowness takes this share of the speed off per level.
23
    public static final double SLOWNESS_PER_LEVEL = 0.15;
24
25
    // The friction of plain ground. Slime is stickier which drags the top speed down.
26
    private static final float NORMAL_FRICTION = 0.6f;
27
28
    private static final String TIMER_KEY = "noslowdown";
29
30
    private final BoolSetting items = new BoolSetting("Items",
31
        "Eating and drinking and drawing a bow no longer slow you.", true);
32
    private final BoolSetting airStrict = new BoolSetting("Air strict",
33
        "Tells the server you sneak whilst you use an item. Some anticheats then allow the speed.", false)
34
        .under(items);
35
    private final BoolSetting sneaking = new BoolSetting("Sneaking",
36
        "Sneaking no longer slows you down. You can even sprint whilst you sneak.", false);
37
    private final BoolSetting hunger = new BoolSetting("Hunger",
38
        "Sprint with an empty hunger bar.", true);
39
    private final BoolSetting slowness = new BoolSetting("Slowness",
40
        "The slowness effect no longer slows you.", true);
41
    private final BoolSetting honey = new BoolSetting("Honey blocks",
42
        "Walk over honey at full speed.", true);
43
    private final BoolSetting soulSand = new BoolSetting("Soul sand",
44
        "Walk over soul sand and soul soil at full speed.", true);
45
    private final BoolSetting slime = new BoolSetting("Slime blocks",
46
        "Walk over slime blocks at full speed.", true);
47
    private final BoolSetting berryBushes = new BoolSetting("Berry bushes",
48
        "Walk through berry bushes at full speed.", true);
49
    private final EnumSetting<WebMode> webs = new EnumSetting<>("Cobwebs",
50
        "How cobwebs are handled.", WebMode.FULL_SPEED)
51
        .describe(WebMode.FULL_SPEED, "Walk through cobwebs at full speed.")
52
        .describe(WebMode.TIMER, "Speeds the game up whilst you hang in a cobweb off the ground.")
53
        .describe(WebMode.OFF, "Cobwebs slow you as normal.");
54
    private final NumberSetting webTimer = new NumberSetting("Web timer",
55
        "Game speed whilst in a cobweb.", 10, 1, 20, 0.5, "x")
56
        .min(1).under(webs, WebMode.TIMER);
57
    private final BoolSetting fluidDrag = new BoolSetting("Fluid drag",
58
        "Water and lava no longer drag on you. The server still caps how far you get.", false);
59
60
    // Whether the server has been told the sneak that air strict fakes.
61
    private boolean strictTold;
62
63
    public NoSlowdown() {
64
        super("NoSlowdown", "Keeps your full speed through everything that would normally slow you down.",
65
            Category.MOVEMENT);
66
        addSettings(items, airStrict, sneaking, hunger, slowness, honey, soulSand, slime,
67
            berryBushes, webs, webTimer, fluidDrag);
68
        searchTags("noslow", "eating", "sneak speed", "soul sand", "honey", "cobweb");
69
    }
70
71
    @Override
72
    protected void onDisable() {
73
        Timer.override(TIMER_KEY, 1f);
74
        if (strictTold) {
75
            tellShift(false);
76
        }
77
    }
78
79
    public boolean skipsItems() {
80
        return isEnabled() && items.isOn();
81
    }
82
83
    public boolean skipsSneaking() {
84
        return isEnabled() && sneaking.isOn();
85
    }
86
87
    public boolean skipsHunger() {
88
        return isEnabled() && hunger.isOn();
89
    }
90
91
    public boolean skipsSlime() {
92
        return isEnabled() && slime.isOn();
93
    }
94
95
    public boolean skipsBerryBushes() {
96
        return isEnabled() && berryBushes.isOn();
97
    }
98
99
    public boolean skipsWebs() {
100
        return isEnabled() && webs.is(WebMode.FULL_SPEED);
101
    }
102
103
    // Read by EntityMixin. True whilst the local player should read as out of every fluid.
104
    public boolean skipsFluidDrag() {
105
        return isEnabled() && fluidDrag.isOn();
106
    }
107
108
    // True when the block under or around the feet should not drag the speed down.
109
    public boolean skipsBlockFriction(Block block) {
110
        if (!isEnabled()) {
111
            return false;
112
        }
113
        if (block == Blocks.HONEY_BLOCK) {
114
            return honey.isOn();
115
        }
116
        if (block == Blocks.SOUL_SAND || block == Blocks.SOUL_SOIL) {
117
            return soulSand.isOn();
118
        }
119
        return false;
120
    }
121
122
    // The friction the ground under the player should have. Slime reads as plain ground.
123
    public float groundFriction(Block block, float friction) {
124
        if (block == Blocks.SLIME_BLOCK && skipsSlime()) {
125
            return NORMAL_FRICTION;
126
        }
127
        return friction;
128
    }
129
130
    // The speed with the slowness share put back. Level six leaves nothing to restore.
131
    public float withoutSlowness(float speed, int amplifier) {
132
        if (!isEnabled() || !slowness.isOn()) {
133
            return speed;
134
        }
135
        double kept = 1 - SLOWNESS_PER_LEVEL * (amplifier + 1);
136
        return kept <= 0 ? speed : (float) (speed / kept);
137
    }
138
139
    @Subscribe
140
    private void onTick(TickEvent event) {
141
        if (!inGame()) {
142
            return;
143
        }
144
        boolean hanging = webs.is(WebMode.TIMER) && !mc.player.onGround()
145
            && mc.player.getInBlockState().is(Blocks.COBWEB);
146
        Timer.override(TIMER_KEY, hanging ? webTimer.getFloat() : 1f);
147
148
        boolean strict = items.isOn() && airStrict.isOn() && mc.player.isUsingItem();
149
        if (strict != strictTold) {
150
            tellShift(strict);
151
        }
152
    }
153
154
    private void tellShift(boolean shift) {
155
        strictTold = shift;
156
        InputUtil.sendShift(shift);
157
    }
158
159
    @Subscribe
160
    private void onPacketSend(PacketSendEvent event) {
161
        if (strictTold) {
162
            InputUtil.keepShift(event);
163
        }
164
    }
165
}
166