AutoSwitch module

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

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.

OfflineClientPLAYERsrc/main/java/com/jellypudding/offlineclient/modules/player/AutoSwitch.javaJava · 40 lines · 1.3 KB

Cycles through your hotbar slots on their own.

SettingsDelay
AutoSwitch.javaJava · Minecraft 26.2 · 40 lines · 1.3 KB · complete file, verbatimOriginal ↗
1
package com.jellypudding.offlineclient.modules.player;
2
3
import com.jellypudding.offlineclient.event.Subscribe;
4
import com.jellypudding.offlineclient.event.events.TickEvent;
5
import com.jellypudding.offlineclient.module.Category;
6
import com.jellypudding.offlineclient.module.Module;
7
import com.jellypudding.offlineclient.setting.NumberSetting;
8
import com.jellypudding.offlineclient.util.InventoryUtil;
9
import net.minecraft.world.entity.player.Inventory;
10
11
// A troll. The held slot walks along the hotbar and wraps round.
12
public final class AutoSwitch extends Module {
13
14
    private final NumberSetting delay = new NumberSetting("Delay",
15
        "Ticks the hand rests on each slot.", 1, 1, 20, 1, " ticks").min(1);
16
17
    private int timer;
18
19
    public AutoSwitch() {
20
        super("AutoSwitch", "Cycles through your hotbar slots on their own.", Category.PLAYER);
21
        addSettings(delay);
22
        searchTags("auto switch", "hotbar cycle", "troll");
23
    }
24
25
    @Override
26
    protected void onEnable() {
27
        timer = 0;
28
    }
29
30
    @Subscribe
31
    private void onTick(TickEvent event) {
32
        if (!inGame() || ++timer < delay.getInt()) {
33
            return;
34
        }
35
        timer = 0;
36
        Inventory inventory = mc.player.getInventory();
37
        inventory.setSelectedSlot((inventory.getSelectedSlot() + 1) % InventoryUtil.HOTBAR_SIZE);
38
    }
39
}
40