self-web module

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

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.

Meteor ClientCombatsrc/main/java/meteordevelopment/meteorclient/systems/modules/combat/SelfWeb.javaJava · 92 lines · 3.0 KB

Automatically places webs on you.

Settingsmoderangedouble-placeauto-togglerotate
SelfWeb.javaJava · Minecraft 26.2 · 92 lines · 3.0 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.combat;
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.entity.SortPriority;
13
import meteordevelopment.meteorclient.utils.entity.TargetUtils;
14
import meteordevelopment.meteorclient.utils.player.FindItemResult;
15
import meteordevelopment.meteorclient.utils.player.InvUtils;
16
import meteordevelopment.meteorclient.utils.world.BlockUtils;
17
import meteordevelopment.orbit.EventHandler;
18
import net.minecraft.world.item.Items;
19
20
public class SelfWeb extends Module {
21
    private final SettingGroup sgGeneral = settings.getDefaultGroup();
22
23
    private final Setting<Mode> mode = sgGeneral.add(new EnumSetting.Builder<Mode>()
24
        .name("mode")
25
        .description("The mode to use for selfweb.")
26
        .defaultValue(Mode.Normal)
27
        .build()
28
    );
29
30
    private final Setting<Integer> range = sgGeneral.add(new IntSetting.Builder()
31
        .name("range")
32
        .description("How far away the player has to be from you to place webs. Requires Mode to Smart.")
33
        .defaultValue(3)
34
        .min(1)
35
        .sliderRange(1, 7)
36
        .visible(() -> mode.get() == Mode.Smart)
37
        .build()
38
    );
39
40
    private final Setting<Boolean> doubles = sgGeneral.add(new BoolSetting.Builder()
41
        .name("double-place")
42
        .description("Places webs in your upper hitbox as well.")
43
        .defaultValue(false)
44
        .build()
45
    );
46
47
    private final Setting<Boolean> turnOff = sgGeneral.add(new BoolSetting.Builder()
48
        .name("auto-toggle")
49
        .description("Toggles off after placing the webs.")
50
        .defaultValue(true)
51
        .build()
52
    );
53
54
    private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder()
55
        .name("rotate")
56
        .description("Forces you to rotate downwards when placing webs.")
57
        .defaultValue(true)
58
        .build()
59
    );
60
61
    public SelfWeb() {
62
        super(Categories.Combat, "self-web", "Automatically places webs on you.");
63
    }
64
65
    @EventHandler
66
    private void onTick(TickEvent.Pre event) {
67
        switch (mode.get()) {
68
            case Normal -> placeWeb();
69
            case Smart -> {
70
                if (TargetUtils.getPlayerTarget(range.get(), SortPriority.LowestDistance) != null) placeWeb();
71
            }
72
        }
73
    }
74
75
    private void placeWeb() {
76
        FindItemResult web = InvUtils.findInHotbar(Items.COBWEB);
77
78
        BlockUtils.place(mc.player.blockPosition(), web, rotate.get(), 0, false);
79
80
        if (doubles.get()) {
81
            BlockUtils.place(mc.player.blockPosition().offset(0, 1, 0), web, rotate.get(), 0, false);
82
        }
83
84
        if (turnOff.get()) toggle();
85
    }
86
87
    public enum Mode {
88
        Normal,
89
        Smart
90
    }
91
}
92