no-ghost-blocks module

no-ghost-blocks: Minecraft 26.3 cheat module, full source for every implementation (1 client: Meteor 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.

Meteor ClientWorldsrc/main/java/meteordevelopment/meteorclient/systems/modules/world/NoGhostBlocks.javaJava · 56 lines · 1.9 KB

Attempts to prevent ghost blocks arising.

Settingsbreakingplacing
NoGhostBlocks.javaJava · Minecraft 26.2 · 56 lines · 1.9 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.world;
7
8
import meteordevelopment.meteorclient.events.entity.player.BreakBlockEvent;
9
import meteordevelopment.meteorclient.events.entity.player.PlaceBlockEvent;
10
import meteordevelopment.meteorclient.settings.BoolSetting;
11
import meteordevelopment.meteorclient.settings.Setting;
12
import meteordevelopment.meteorclient.settings.SettingGroup;
13
import meteordevelopment.meteorclient.systems.modules.Categories;
14
import meteordevelopment.meteorclient.systems.modules.Module;
15
import meteordevelopment.orbit.EventHandler;
16
import net.minecraft.world.level.block.state.BlockState;
17
18
public class NoGhostBlocks extends Module {
19
    private final SettingGroup sgGeneral = settings.getDefaultGroup();
20
21
    private final Setting<Boolean> breaking = sgGeneral.add(new BoolSetting.Builder()
22
        .name("breaking")
23
        .description("Whether to apply for block breaking actions.")
24
        .defaultValue(true)
25
        .build()
26
    );
27
28
    public final Setting<Boolean> placing = sgGeneral.add(new BoolSetting.Builder()
29
        .name("placing")
30
        .description("Whether to apply for block placement actions.")
31
        .defaultValue(true)
32
        .build()
33
    );
34
35
    public NoGhostBlocks() {
36
        super(Categories.World, "no-ghost-blocks", "Attempts to prevent ghost blocks arising.");
37
    }
38
39
    @EventHandler
40
    private void onBreakBlock(BreakBlockEvent event) {
41
        if (mc.isLocalServer() || !breaking.get()) return;
42
43
        event.cancel();
44
45
        BlockState blockState = mc.level.getBlockState(event.blockPos);
46
        blockState.getBlock().playerWillDestroy(mc.level, event.blockPos, blockState, mc.player);
47
    }
48
49
    @EventHandler
50
    private void onPlaceBlock(PlaceBlockEvent event) {
51
        if (!placing.get()) return;
52
53
        event.cancel();
54
    }
55
}
56