self-anvil module

self-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/SelfAnvil.javaJava · 36 lines · 1.4 KB

Automatically places an anvil on you to prevent other players from going into your hole.

SelfAnvil.javaJava · Minecraft 26.2 · 36 lines · 1.4 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.game.OpenScreenEvent;
9
import meteordevelopment.meteorclient.events.world.TickEvent;
10
import meteordevelopment.meteorclient.systems.modules.Categories;
11
import meteordevelopment.meteorclient.systems.modules.Module;
12
import meteordevelopment.meteorclient.utils.player.InvUtils;
13
import meteordevelopment.meteorclient.utils.world.BlockUtils;
14
import meteordevelopment.orbit.EventHandler;
15
import net.minecraft.client.gui.screens.inventory.AnvilScreen;
16
import net.minecraft.world.level.block.AnvilBlock;
17
import net.minecraft.world.level.block.Block;
18
19
public class SelfAnvil extends Module {
20
    public SelfAnvil() {
21
        super(Categories.Combat, "self-anvil", "Automatically places an anvil on you to prevent other players from going into your hole.");
22
    }
23
24
    @EventHandler
25
    private void onOpenScreen(OpenScreenEvent event) {
26
        if (event.screen instanceof AnvilScreen) event.cancel();
27
    }
28
29
    @EventHandler
30
    private void onTick(TickEvent.Pre event) {
31
        if (BlockUtils.place(mc.player.blockPosition().offset(0, 2, 0), InvUtils.findInHotbar(itemStack -> Block.byItem(itemStack.getItem()) instanceof AnvilBlock), 0)) {
32
            toggle();
33
        }
34
    }
35
}
36