TillAura module

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

1 implementationWORLD

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.

OfflineClientWORLDsrc/main/java/com/jellypudding/offlineclient/modules/world/TillAura.javaJava · 89 lines · 3.2 KB

Tills the dirt around you with the hoe in your hand.

SettingsRangeMulti tillLine of sightRotate
TillAura.javaJava · Minecraft 26.2 · 89 lines · 3.2 KB · complete file, verbatimOriginal ↗
1
package com.jellypudding.offlineclient.modules.world;
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.BoolSetting;
8
import com.jellypudding.offlineclient.setting.NumberSetting;
9
import com.jellypudding.offlineclient.util.BlockUtil;
10
import net.minecraft.core.BlockPos;
11
import net.minecraft.world.item.HoeItem;
12
import net.minecraft.world.level.block.Block;
13
import net.minecraft.world.level.block.Blocks;
14
15
import java.util.Set;
16
17
// Turns the ground around you into farmland whilst you hold a hoe.
18
public final class TillAura extends Module {
19
20
    private static final Set<Block> TILLABLE = Set.of(
21
        Blocks.GRASS_BLOCK, Blocks.DIRT_PATH, Blocks.DIRT, Blocks.COARSE_DIRT, Blocks.ROOTED_DIRT);
22
23
    // Vanilla repeats a held right click at this rate.
24
    private static final int CLICK_INTERVAL = 4;
25
26
    private final NumberSetting range = new NumberSetting("Range",
27
        "How far from your eyes to till.", 5, 1, 6, 0.1).max(6);
28
    private final BoolSetting multi = new BoolSetting("Multi till",
29
        "Tills every block in reach at once. Fast but obvious to an anti cheat.", false);
30
    private final BoolSetting lineOfSight = new BoolSetting("Line of sight",
31
        "Only tills blocks you can see from where you stand.", true);
32
    private final BoolSetting rotate = new BoolSetting("Rotate",
33
        "Turn towards the block on the server side.", true);
34
35
    private int tilled;
36
37
    public TillAura() {
38
        super("TillAura", "Tills the dirt around you with the hoe in your hand.", Category.WORLD);
39
        addSettings(range, multi, lineOfSight, rotate);
40
        searchTags("hoe aura", "farmland", "auto till");
41
    }
42
43
    @Override
44
    public String getSuffix() {
45
        return tilled == 0 ? null : tilled + " tilled";
46
    }
47
48
    @Override
49
    protected void onEnable() {
50
        tilled = 0;
51
    }
52
53
    @Subscribe
54
    private void onTick(TickEvent event) {
55
        if (!inGame() || mc.gameMode == null || mc.player.isSpectator() || mc.gui.screen() != null) {
56
            return;
57
        }
58
        if (mc.gameMode.isDestroying() || mc.player.isHandsBusy()) {
59
            return;
60
        }
61
        if (!(mc.player.getMainHandItem().getItem() instanceof HoeItem)) {
62
            return;
63
        }
64
        if (!multi.isOn() && mc.rightClickDelay > 0) {
65
            return;
66
        }
67
        for (BlockPos pos : BlockUtil.positionsWithin(range.getValue())) {
68
            if (!tillable(pos)) {
69
                continue;
70
            }
71
            if (BlockUtil.useOn(pos, rotate.isOn(), !multi.isOn())) {
72
                tilled++;
73
                if (!multi.isOn()) {
74
                    mc.rightClickDelay = CLICK_INTERVAL;
75
                    return;
76
                }
77
            }
78
        }
79
    }
80
81
    // Farmland only forms under open air.
82
    private boolean tillable(BlockPos pos) {
83
        if (!TILLABLE.contains(BlockUtil.state(pos).getBlock()) || !BlockUtil.state(pos.above()).isAir()) {
84
            return false;
85
        }
86
        return !lineOfSight.isOn() || BlockUtil.canSee(pos);
87
    }
88
}
89