speed-mine module

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

1 implementationPlayer

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 ClientPlayersrc/main/java/meteordevelopment/meteorclient/systems/modules/player/SpeedMine.javaJava · 149 lines · 5.4 KB

Allows you to quickly mine blocks.

Settingsmodeblocksblocks-filtermodifierhaste-amplifierinstaminegrim-bypass
SpeedMine.javaJava · Minecraft 26.2 · 149 lines · 5.4 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.player;
7
8
import meteordevelopment.meteorclient.events.packets.PacketEvent;
9
import meteordevelopment.meteorclient.events.world.TickEvent;
10
import meteordevelopment.meteorclient.mixin.MultiPlayerGameModeAccessor;
11
import meteordevelopment.meteorclient.settings.*;
12
import meteordevelopment.meteorclient.systems.modules.Categories;
13
import meteordevelopment.meteorclient.systems.modules.Module;
14
import meteordevelopment.meteorclient.utils.Utils;
15
import meteordevelopment.meteorclient.utils.misc.ListMode;
16
import meteordevelopment.orbit.EventHandler;
17
import net.minecraft.core.BlockPos;
18
import net.minecraft.network.protocol.game.ServerboundPlayerActionPacket;
19
import net.minecraft.world.effect.MobEffectInstance;
20
import net.minecraft.world.level.block.Block;
21
22
import java.util.List;
23
24
import static net.minecraft.world.effect.MobEffects.HASTE;
25
26
public class SpeedMine extends Module {
27
    private final SettingGroup sgGeneral = settings.getDefaultGroup();
28
29
    public final Setting<Mode> mode = sgGeneral.add(new EnumSetting.Builder<Mode>()
30
        .name("mode")
31
        .defaultValue(Mode.Damage)
32
        .onChanged(_ -> removeHaste())
33
        .build()
34
    );
35
36
    private final Setting<List<Block>> blocks = sgGeneral.add(new BlockListSetting.Builder()
37
        .name("blocks")
38
        .description("Selected blocks.")
39
        .filter(block -> block.defaultDestroyTime() > 0)
40
        .visible(() -> mode.get() != Mode.Haste)
41
        .build()
42
    );
43
44
    private final Setting<ListMode> blocksFilter = sgGeneral.add(new EnumSetting.Builder<ListMode>()
45
        .name("blocks-filter")
46
        .description("How to use the blocks setting.")
47
        .defaultValue(ListMode.Blacklist)
48
        .visible(() -> mode.get() != Mode.Haste)
49
        .build()
50
    );
51
52
    public final Setting<Double> modifier = sgGeneral.add(new DoubleSetting.Builder()
53
        .name("modifier")
54
        .description("Mining speed modifier. An additional value of 0.2 is equivalent to one haste level (1.2 = haste 1).")
55
        .defaultValue(1.4)
56
        .visible(() -> mode.get() == Mode.Normal)
57
        .min(0)
58
        .build()
59
    );
60
61
    private final Setting<Integer> hasteAmplifier = sgGeneral.add(new IntSetting.Builder()
62
        .name("haste-amplifier")
63
        .description("What value of haste to give you. Above 2 not recommended.")
64
        .defaultValue(2)
65
        .min(1)
66
        .visible(() -> mode.get() == Mode.Haste)
67
        .onChanged(_ -> removeHaste())
68
        .build()
69
    );
70
71
    private final Setting<Boolean> instamine = sgGeneral.add(new BoolSetting.Builder()
72
        .name("instamine")
73
        .description("Whether or not to instantly mine blocks under certain conditions.")
74
        .defaultValue(true)
75
        .visible(() -> mode.get() == Mode.Damage)
76
        .build()
77
    );
78
79
    private final Setting<Boolean> grimBypass = sgGeneral.add(new BoolSetting.Builder()
80
        .name("grim-bypass")
81
        .description("Bypasses Grim's fastbreak check, working as of 2.3.58")
82
        .defaultValue(false)
83
        .visible(() -> mode.get() == Mode.Damage)
84
        .build()
85
    );
86
87
    public SpeedMine() {
88
        super(Categories.Player, "speed-mine", "Allows you to quickly mine blocks.");
89
    }
90
91
    @Override
92
    public void onDeactivate() {
93
        removeHaste();
94
    }
95
96
    @EventHandler
97
    private void onTick(TickEvent.Pre event) {
98
        if (!Utils.canUpdate()) return;
99
100
        if (mode.get() == Mode.Haste) {
101
            MobEffectInstance haste = mc.player.getEffect(HASTE);
102
103
            if (haste == null || haste.getAmplifier() <= hasteAmplifier.get() - 1) {
104
                mc.player.addEffect(new MobEffectInstance(HASTE, -1, hasteAmplifier.get() - 1, false, false, false), null);
105
            }
106
        } else if (mode.get() == Mode.Damage) {
107
            MultiPlayerGameModeAccessor im = (MultiPlayerGameModeAccessor) mc.gameMode;
108
            float progress = im.meteor$getBreakingProgress();
109
            BlockPos pos = im.meteor$getCurrentBreakingBlockPos();
110
111
            if (pos == null || progress <= 0) return;
112
            if (progress + mc.level.getBlockState(pos).getDestroyProgress(mc.player, mc.level, pos) >= 0.7f)
113
                im.meteor$setDestroyProgress(1f);
114
        }
115
    }
116
117
    @EventHandler
118
    private void onPacket(PacketEvent.Send event) {
119
        if (mode.get() != Mode.Damage || !grimBypass.get()) return;
120
121
        // https://github.com/GrimAnticheat/Grim/issues/1296
122
        if (event.packet instanceof ServerboundPlayerActionPacket packet && packet.getAction() == ServerboundPlayerActionPacket.Action.STOP_DESTROY_BLOCK) {
123
            mc.getConnection().send(new ServerboundPlayerActionPacket(ServerboundPlayerActionPacket.Action.ABORT_DESTROY_BLOCK, packet.getPos().above(), packet.getDirection()));
124
        }
125
    }
126
127
    private void removeHaste() {
128
        if (!Utils.canUpdate()) return;
129
130
        MobEffectInstance haste = mc.player.getEffect(HASTE);
131
        if (haste != null && !haste.showIcon()) mc.player.removeEffect(HASTE);
132
    }
133
134
    public boolean filter(Block block) {
135
        return blocksFilter.get().allows(blocks.get().contains(block));
136
    }
137
138
    public boolean instamine() {
139
        return isActive() && mode.get() == Mode.Damage && instamine.get();
140
    }
141
142
    public enum Mode {
143
        Normal,
144
        Haste,
145
        Damage
146
    }
147
148
}
149