BedNuker module

BedNuker: Minecraft 26.3 cheat module, full source for every implementation (1 client: Goon Client).

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.

Goon ClientWorldsrc/main/java/com/pendonym/module/world/BedNuker.javaJava · 67 lines · 2.1 KB
BedNuker.javaJava · Minecraft 26.2 · 67 lines · 2.1 KB · complete file, verbatim
1
package com.pendonym.module.world;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.core.Direction;
5
import net.minecraft.network.protocol.game.ServerboundSwingPacket;
6
import net.minecraft.world.InteractionHand;
7
import net.minecraft.world.level.block.BedBlock;
8
import net.minecraft.world.level.block.Block;
9
import net.minecraft.world.phys.BlockHitResult;
10
import com.pendonym.module.Module;
11
import com.pendonym.util.Rotations;
12
13
import static com.pendonym.GoonClient.mc;
14
15
@Module.Info(name = "key.module.goon.bed_nuker", category = "World")
16
public class BedNuker extends Module {
17
    public static final BedNuker INSTANCE = new BedNuker();
18
19
    @Override
20
    public void onTick() {
21
        if (mc.player == null || mc.level == null || mc.gameMode == null) {
22
            return;
23
        }
24
25
        BlockPos blockPos = findTargetBed(mc.player.getX(), mc.player.getY() + (double) mc.player.getEyeHeight(), mc.player.getZ());
26
27
        if (blockPos == null) {
28
            return;
29
        }
30
31
        Rotations.lookAt(blockPos);
32
33
        if (mc.hitResult instanceof BlockHitResult blockHitResult) {
34
            Direction direction = blockHitResult.getDirection();
35
36
            if (mc.gameMode == null) {
37
                return;
38
            }
39
40
            mc.gameMode.continueDestroyBlock(blockPos, direction);
41
            mc.player.connection.send(new ServerboundSwingPacket(InteractionHand.MAIN_HAND));
42
43
            mc.player.swing(InteractionHand.MAIN_HAND);
44
        }
45
    }
46
47
    private BlockPos findTargetBed(double x, double y, double z) {
48
        int fX = (int) Math.floor(x);
49
        int fY = (int) Math.floor(y);
50
        int fZ = (int) Math.floor(z);
51
52
        for (int i = fX - 6; i <= fX + 6; i++) {
53
            for (int j = fY - 6; j <= fY + 6; j++) {
54
                for (int k = fZ - 6; k <= fZ + 6; k++) {
55
                    BlockPos newPos = new BlockPos(i, j, k);
56
57
                    Block block = mc.level.getBlockState(newPos).getBlock();
58
                    if (block instanceof BedBlock) {
59
                        return newPos;
60
                    }
61
                }
62
            }
63
        }
64
        return null;
65
    }
66
}
67