SelfWeb module

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

1 implementationCOMBAT

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.

OfflineClientCOMBATsrc/main/java/com/jellypudding/offlineclient/modules/combat/SelfWeb.javaJava · 62 lines · 2.5 KB

Webs your own block to stop knockback.

SettingsModeEnemy rangeUpper bodyToggle off when doneRotate
SelfWeb.javaJava · Minecraft 26.2 · 62 lines · 2.5 KB · complete file, verbatimOriginal ↗
1
package com.jellypudding.offlineclient.modules.combat;
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.EnumSetting;
9
import com.jellypudding.offlineclient.setting.NumberSetting;
10
import com.jellypudding.offlineclient.util.EntityUtil;
11
import com.jellypudding.offlineclient.util.InventoryUtil.SlotSwap;
12
import net.minecraft.core.BlockPos;
13
14
public final class SelfWeb extends Module {
15
16
    public enum Mode { ALWAYS, ENEMY_NEAR }
17
18
    private final EnumSetting<Mode> mode = new EnumSetting<>("Mode",
19
        "When the web goes down.", Mode.ALWAYS)
20
        .describe(Mode.ALWAYS, "Webs your block as soon as it is turned on.")
21
        .describe(Mode.ENEMY_NEAR, "Waits until an enemy comes within range.");
22
    private final NumberSetting range = new NumberSetting("Enemy range",
23
        "How close an enemy has to be.", 4, 1, 10, 0.5, " blocks")
24
        .under(mode, Mode.ENEMY_NEAR);
25
    private final BoolSetting doubles = new BoolSetting("Upper body",
26
        "Also web the block your head is in.", false);
27
    private final BoolSetting toggleOff = new BoolSetting("Toggle off when done",
28
        "Turn off once the web is down.", true);
29
    private final BoolSetting rotate = new BoolSetting("Rotate",
30
        "Send a look packet towards the web.", true);
31
32
    private final SlotSwap slots = new SlotSwap();
33
34
    public SelfWeb() {
35
        super("SelfWeb", "Webs your own block to stop knockback.", Category.COMBAT);
36
        addSettings(mode, range, doubles, toggleOff, rotate);
37
        searchTags("cobweb", "web", "anti knockback");
38
    }
39
40
    @Subscribe
41
    private void onTick(TickEvent event) {
42
        if (!inGame() || mc.player.isSpectator()) {
43
            return;
44
        }
45
        if (mode.is(Mode.ENEMY_NEAR) && EntityUtil.nearestEnemy(range.getValue()) == null) {
46
            return;
47
        }
48
49
        BlockPos feet = mc.player.blockPosition();
50
        AutoWeb.placeWeb(feet, rotate.isOn(), slots);
51
        if (doubles.isOn()) {
52
            AutoWeb.placeWeb(feet.above(), rotate.isOn(), slots);
53
        }
54
        // The client puts its own copy down.
55
        boolean done = !AutoWeb.webbable(feet)
56
            && (!doubles.isOn() || !AutoWeb.webbable(feet.above()));
57
        if (toggleOff.isOn() && done) {
58
            setEnabled(false);
59
        }
60
    }
61
}
62