auto-clicker module

auto-clicker: 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/AutoClicker.javaJava · 116 lines · 3.5 KB

Automatically clicks.

Settingswhile-in-screensmode-leftdelay-leftmode-rightdelay-right
AutoClicker.javaJava · Minecraft 26.2 · 116 lines · 3.5 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.world.TickEvent;
9
import meteordevelopment.meteorclient.settings.*;
10
import meteordevelopment.meteorclient.systems.modules.Categories;
11
import meteordevelopment.meteorclient.systems.modules.Module;
12
import meteordevelopment.meteorclient.utils.Utils;
13
import meteordevelopment.orbit.EventHandler;
14
15
public class AutoClicker extends Module {
16
    private final SettingGroup sgGeneral = settings.getDefaultGroup();
17
18
    private final Setting<Boolean> inScreens = sgGeneral.add(new BoolSetting.Builder()
19
        .name("while-in-screens")
20
        .description("Whether to click while a screen is open.")
21
        .defaultValue(true)
22
        .build()
23
    );
24
25
    private final Setting<Mode> leftClickMode = sgGeneral.add(new EnumSetting.Builder<Mode>()
26
        .name("mode-left")
27
        .description("The method of clicking for left clicks.")
28
        .defaultValue(Mode.Press)
29
        .build()
30
    );
31
32
    private final Setting<Integer> leftClickDelay = sgGeneral.add(new IntSetting.Builder()
33
        .name("delay-left")
34
        .description("The amount of delay between left clicks in ticks.")
35
        .defaultValue(2)
36
        .min(0)
37
        .sliderMax(60)
38
        .visible(() -> leftClickMode.get() == Mode.Press)
39
        .build()
40
    );
41
42
    private final Setting<Mode> rightClickMode = sgGeneral.add(new EnumSetting.Builder<Mode>()
43
        .name("mode-right")
44
        .description("The method of clicking for right clicks.")
45
        .defaultValue(Mode.Press)
46
        .build()
47
    );
48
49
    private final Setting<Integer> rightClickDelay = sgGeneral.add(new IntSetting.Builder()
50
        .name("delay-right")
51
        .description("The amount of delay between right clicks in ticks.")
52
        .defaultValue(2)
53
        .min(0)
54
        .sliderMax(60)
55
        .visible(() -> rightClickMode.get() == Mode.Press)
56
        .build()
57
    );
58
59
    private int rightClickTimer, leftClickTimer;
60
61
    public AutoClicker() {
62
        super(Categories.Player, "auto-clicker", "Automatically clicks.");
63
    }
64
65
    @Override
66
    public void onActivate() {
67
        rightClickTimer = 0;
68
        leftClickTimer = 0;
69
        mc.options.keyAttack.setDown(false);
70
        mc.options.keyUse.setDown(false);
71
    }
72
73
    @Override
74
    public void onDeactivate() {
75
        mc.options.keyAttack.setDown(false);
76
        mc.options.keyUse.setDown(false);
77
    }
78
79
    @EventHandler
80
    private void onTick(TickEvent.Post event) {
81
        if (!inScreens.get() && mc.gui.screen() != null) return;
82
83
        switch (leftClickMode.get()) {
84
            case Disabled -> {
85
            }
86
            case Hold -> mc.options.keyAttack.setDown(true);
87
            case Press -> {
88
                leftClickTimer++;
89
                if (leftClickTimer > leftClickDelay.get()) {
90
                    Utils.leftClick();
91
                    leftClickTimer = 0;
92
                }
93
            }
94
        }
95
96
        switch (rightClickMode.get()) {
97
            case Disabled -> {
98
            }
99
            case Hold -> mc.options.keyUse.setDown(true);
100
            case Press -> {
101
                rightClickTimer++;
102
                if (rightClickTimer > rightClickDelay.get()) {
103
                    Utils.rightClick();
104
                    rightClickTimer = 0;
105
                }
106
            }
107
        }
108
    }
109
110
    public enum Mode {
111
        Disabled,
112
        Hold,
113
        Press
114
    }
115
}
116