anti-anvil module

anti-anvil: 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/AntiAnvil.javaJava · 54 lines · 2.1 KB

Automatically prevents Auto Anvil by placing between you and the anvil.

Settingsswingrotate
AntiAnvil.javaJava · Minecraft 26.2 · 54 lines · 2.1 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.BoolSetting;
10
import meteordevelopment.meteorclient.settings.Setting;
11
import meteordevelopment.meteorclient.settings.SettingGroup;
12
import meteordevelopment.meteorclient.systems.modules.Categories;
13
import meteordevelopment.meteorclient.systems.modules.Module;
14
import meteordevelopment.meteorclient.utils.player.InvUtils;
15
import meteordevelopment.meteorclient.utils.world.BlockUtils;
16
import meteordevelopment.orbit.EventHandler;
17
import net.minecraft.core.BlockPos;
18
import net.minecraft.world.item.Items;
19
import net.minecraft.world.level.block.Blocks;
20
21
public class AntiAnvil extends Module {
22
    private final SettingGroup sgGeneral = settings.getDefaultGroup();
23
24
    private final Setting<Boolean> swing = sgGeneral.add(new BoolSetting.Builder()
25
        .name("swing")
26
        .description("Swings your hand client-side when placing.")
27
        .defaultValue(true)
28
        .build()
29
    );
30
31
    private final Setting<Boolean> rotate = sgGeneral.add(new BoolSetting.Builder()
32
        .name("rotate")
33
        .description("Makes you rotate when placing.")
34
        .defaultValue(true)
35
        .build()
36
    );
37
38
    public AntiAnvil() {
39
        super(Categories.Combat, "anti-anvil", "Automatically prevents Auto Anvil by placing between you and the anvil.");
40
    }
41
42
    @EventHandler
43
    private void onTick(TickEvent.Pre event) {
44
        for (int i = 0; i <= mc.player.blockInteractionRange(); i++) {
45
            BlockPos pos = mc.player.blockPosition().offset(0, i + 3, 0);
46
47
            if (mc.level.getBlockState(pos).getBlock() == Blocks.ANVIL && mc.level.getBlockState(pos.below()).isAir()) {
48
                if (BlockUtils.place(pos.below(), InvUtils.findInHotbar(Items.OBSIDIAN), rotate.get(), 15, swing.get(), true))
49
                    break;
50
            }
51
        }
52
    }
53
}
54