GhostHand module

GhostHand: Minecraft 26.3 cheat module, full source for every implementation (2 clients: OfflineClient, LiquidBounce (Kotlin)).

2 implementationsPLAYEREXPLOIT

Full module source: 2 implementations

Every implementation below is the complete module file, verbatim. Expand a client to read its code.

OfflineClientPLAYERsrc/main/java/com/jellypudding/offlineclient/modules/player/GhostHand.javaJava · 108 lines · 4.3 KB

Opens containers through walls.

SettingsAny containerBlocksSee through walls
GhostHand.javaJava · Minecraft 26.2 · 108 lines · 4.3 KB · complete file, verbatimOriginal ↗
1
package com.jellypudding.offlineclient.modules.player;
2
3
import com.jellypudding.offlineclient.event.Subscribe;
4
import com.jellypudding.offlineclient.event.events.RightClickEvent;
5
import com.jellypudding.offlineclient.module.Category;
6
import com.jellypudding.offlineclient.module.Module;
7
import com.jellypudding.offlineclient.setting.BoolSetting;
8
import com.jellypudding.offlineclient.setting.RegistryListSetting;
9
import net.minecraft.core.BlockPos;
10
import net.minecraft.core.registries.BuiltInRegistries;
11
import net.minecraft.core.Direction;
12
import net.minecraft.world.InteractionHand;
13
import net.minecraft.world.InteractionResult;
14
import net.minecraft.world.level.block.Block;
15
import net.minecraft.world.level.block.Blocks;
16
import net.minecraft.world.level.block.ShulkerBoxBlock;
17
import net.minecraft.world.phys.BlockHitResult;
18
import net.minecraft.world.phys.HitResult;
19
import net.minecraft.world.phys.Vec3;
20
21
import java.util.ArrayList;
22
import java.util.HashSet;
23
import java.util.List;
24
import java.util.Set;
25
26
// Opens containers through walls.
27
public final class GhostHand extends Module {
28
29
    // The delay a normal right click leaves behind.
30
    private static final int USE_DELAY = 4;
31
32
    private final BoolSetting everything = new BoolSetting("Any container",
33
        "Reach through walls for anything that opens a screen.", true);
34
    private final RegistryListSetting<Block> blocks = new RegistryListSetting<>("Blocks",
35
        "The containers you can reach through walls.", BuiltInRegistries.BLOCK, defaultBlocks())
36
        .unless(everything);
37
38
    private final BoolSetting seeThrough = new BoolSetting("See through walls",
39
        "Empties the outline of every other block so the crosshair itself lands on the container. Nothing else can be clicked whilst this is on.",
40
        false);
41
42
    public GhostHand() {
43
        super("GhostHand", "Opens containers through walls.", Category.PLAYER);
44
        addSettings(everything, blocks, seeThrough);
45
        searchTags("through walls", "chest", "hand no clip");
46
    }
47
48
    // Read by BlockStateBaseMixin. True for a block the crosshair should pass through.
49
    public boolean passesThrough(BlockPos pos) {
50
        return isEnabled() && seeThrough.isOn() && inGame() && !wanted(pos);
51
    }
52
53
    // The usual storage plus every colour of shulker box.
54
    private static List<Block> defaultBlocks() {
55
        List<Block> list = new ArrayList<>(List.of(Blocks.CHEST, Blocks.TRAPPED_CHEST,
56
            Blocks.ENDER_CHEST, Blocks.BARREL, Blocks.DISPENSER, Blocks.DROPPER, Blocks.HOPPER));
57
        BuiltInRegistries.BLOCK.stream().filter(block -> block instanceof ShulkerBoxBlock)
58
            .forEach(list::add);
59
        return list;
60
    }
61
62
    // True for a block this module is allowed to open from here.
63
    private boolean wanted(BlockPos pos) {
64
        if (mc.level.getBlockState(pos).getMenuProvider(mc.level, pos) == null) {
65
            return false;
66
        }
67
        return everything.isOn() || blocks.contains(mc.level.getBlockState(pos).getBlock());
68
    }
69
70
    @Subscribe
71
    private void onRightClick(RightClickEvent event) {
72
        if (event.isCancelled() || !inGame() || mc.gameMode == null) {
73
            return;
74
        }
75
        if (mc.player.isSpectator() || mc.player.isShiftKeyDown()) {
76
            return;
77
        }
78
        if (mc.hitResult instanceof BlockHitResult hit && hit.getType() == HitResult.Type.BLOCK
79
            && wanted(hit.getBlockPos())) {
80
            return;
81
        }
82
83
        double reach = mc.player.blockInteractionRange();
84
        Vec3 eye = mc.player.getEyePosition();
85
        Vec3 step = mc.player.getViewVector(1f).scale(0.1);
86
        Set<BlockPos> visited = new HashSet<>();
87
88
        for (int i = 1; i <= reach * 10; i++) {
89
            BlockPos pos = BlockPos.containing(eye.add(step.scale(i)));
90
            if (!visited.add(pos)) {
91
                continue;
92
            }
93
            if (!wanted(pos)) {
94
                continue;
95
            }
96
            BlockHitResult hit = new BlockHitResult(Vec3.atCenterOf(pos), Direction.UP, pos, true);
97
            // Cancelling skips the delay the game would have set itself.
98
            mc.rightClickDelay = USE_DELAY;
99
            InteractionResult result = mc.gameMode.useItemOn(mc.player, InteractionHand.MAIN_HAND, hit);
100
            if (result.consumesAction()) {
101
                mc.player.swing(InteractionHand.MAIN_HAND);
102
            }
103
            event.cancel();
104
            return;
105
        }
106
    }
107
}
108
LiquidBounce (Kotlin)EXPLOITsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/exploit/ModuleGhostHand.ktKotlin · 45 lines · 1.5 KB

Allows you to interact with selected blocks through walls.

SettingsTargetedBlocks
ModuleGhostHand.ktKotlin · Minecraft 26.2 · 45 lines · 1.5 KB · complete file, verbatimOriginal ↗
1
/*
2
 * This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
3
 *
4
 * Copyright (c) 2015 - 2026 CCBlueX
5
 *
6
 * LiquidBounce is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * LiquidBounce is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with LiquidBounce. If not, see <https://www.gnu.org/licenses/>.
18
 */
19
package net.ccbluex.liquidbounce.features.module.modules.exploit
20
21
import net.ccbluex.liquidbounce.features.module.ClientModule
22
import net.ccbluex.liquidbounce.features.module.ModuleCategories
23
import net.ccbluex.liquidbounce.utils.collection.blockSortedSetOf
24
import net.ccbluex.liquidbounce.utils.kotlin.addAll
25
import net.minecraft.world.level.block.Blocks
26
27
/**
28
 * GhostHand module
29
 *
30
 * Allows you to interact with selected blocks through walls.
31
 */
32
object ModuleGhostHand : ClientModule("GhostHand", ModuleCategories.EXPLOIT) {
33
34
    val targetedBlocks by blocks("TargetedBlocks", blockSortedSetOf(
35
        Blocks.CHEST,
36
        Blocks.ENDER_CHEST,
37
        Blocks.TRAPPED_CHEST,
38
        Blocks.SHULKER_BOX,
39
    ).apply {
40
        addAll(Blocks.DYED_SHULKER_BOX)
41
    }
42
    )
43
44
}
45