VoidESP module

VoidESP: Minecraft 26.3 cheat module, full source for every implementation (3 clients: MelaHack (ThunderHack fork), OfflineClient, LiquidBounce (Kotlin)).

3 implementationsRENDER

Full module source: 3 implementations

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

MelaHack (ThunderHack fork)RENDERsrc/main/java/thunder/hack/features/modules/render/VoidESP.javaJava · 45 lines · 1.6 KB

Highlights void holes.

SettingsColorRange
VoidESP.javaJava · Minecraft 26.2 · 45 lines · 1.6 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.features.modules.render;
2
3
import thunder.hack.features.modules.Module;
4
import thunder.hack.setting.Setting;
5
import thunder.hack.setting.impl.ColorSetting;
6
import thunder.hack.utility.render.Render3DEngine;
7
import com.mojang.blaze3d.vertex.PoseStack;
8
import java.awt.*;
9
import java.util.ArrayList;
10
import java.util.List;
11
import net.minecraft.core.BlockPos;
12
import net.minecraft.world.level.block.Blocks;
13
import net.minecraft.world.phys.AABB;
14
15
public class VoidESP extends Module {
16
    public VoidESP() {
17
        super("VoidESP", Category.RENDER);
18
    }
19
20
    public final Setting<ColorSetting> color = new Setting<>("Color", new ColorSetting(new Color(0xD7FFA600, true)));
21
    public Setting<Float> range = new Setting<>("Range", 6.0f, 3.0f, 16.0f);
22
23
    private List<BlockPos> holes = new ArrayList<>();
24
25
    public void onRender3D(PoseStack stack) {
26
        holes.forEach(h -> Render3DEngine.renderCrosses(new AABB(h), color.getValue().getColorObject(), 2.0f));
27
    }
28
29
    public List<BlockPos> calcHoles() {
30
        ArrayList<BlockPos> voidHoles = new ArrayList<>();
31
        for (int x = (int) (mc.player.getX() - range.getValue()); x < mc.player.getX() + range.getValue(); x++)
32
            for (int z = (int) (mc.player.getZ() - range.getValue()); z < mc.player.getZ() + range.getValue(); z++) {
33
                BlockPos pos = BlockPos.containing(x, mc.level.getMinY(), z);
34
                if (mc.level.getBlockState(pos).getBlock() == Blocks.BEDROCK) continue;
35
                voidHoles.add(pos);
36
            }
37
        return voidHoles;
38
    }
39
40
    @Override
41
    public void onThread() {
42
        holes = calcHoles();
43
    }
44
}
45
OfflineClientRENDERsrc/main/java/com/jellypudding/offlineclient/modules/render/VoidEsp.javaJava · 161 lines · 6.1 KB

Shows holes in the bedrock that lead to the void.

SettingsRangeDepthAir onlyNether roofConnected
VoidEsp.javaJava · Minecraft 26.2 · 161 lines · 6.1 KB · complete file, verbatimOriginal ↗
1
package com.jellypudding.offlineclient.modules.render;
2
3
import com.jellypudding.offlineclient.event.Subscribe;
4
import com.jellypudding.offlineclient.event.events.PacketReceiveEvent;
5
import com.jellypudding.offlineclient.event.events.Render3DEvent;
6
import com.jellypudding.offlineclient.event.events.TickEvent;
7
import com.jellypudding.offlineclient.module.Category;
8
import com.jellypudding.offlineclient.module.Module;
9
import com.jellypudding.offlineclient.render.BoxStyle;
10
import com.jellypudding.offlineclient.render.DrawBatch;
11
import com.jellypudding.offlineclient.setting.BoolSetting;
12
import com.jellypudding.offlineclient.setting.NumberSetting;
13
import com.jellypudding.offlineclient.util.ChunkScanner;
14
import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
15
import net.minecraft.core.BlockPos;
16
import net.minecraft.world.level.Level;
17
import net.minecraft.world.level.block.Blocks;
18
import net.minecraft.world.level.block.state.BlockState;
19
import net.minecraft.world.phys.AABB;
20
21
import java.util.List;
22
23
public final class VoidEsp extends Module {
24
25
    // The top bedrock layer of the nether roof. The only one always solid.
26
    private static final int NETHER_ROOF_Y = 127;
27
28
    // Holes only ever touch sideways. Every one sits on the same layer.
29
    private record Hole(int x, int y, int z, boolean roof) {
30
    }
31
32
    private final NumberSetting range = new NumberSetting("Range",
33
        "Chunk radius to search around you. Only chunks the game has loaded can be searched.", 6, 1, 12, 1, " chunks").max(64);
34
    private final NumberSetting depth = new NumberSetting("Depth",
35
        "How many bedrock layers must be missing.", 1, 1, 5, 1).min(1).max(5);
36
    private final BoolSetting airOnly = new BoolSetting("Air only",
37
        "Only count columns that are completely open.", false);
38
    private final BoolSetting netherRoof = new BoolSetting("Nether roof",
39
        "Also search the roof whilst you are in the nether.", true);
40
    private final BoolSetting connected = new BoolSetting("Connected",
41
        "Holes that touch leave out the faces they share so a wide hole draws as one box.", true);
42
    private final BoxStyle floorStyle = new BoxStyle("Floor", BoxStyle.Shape.BOTH, 351);
43
    private final BoxStyle roofStyle = new BoxStyle("Roof", BoxStyle.Shape.BOTH, 300)
44
        .under(netherRoof);
45
46
    private final ChunkScanner<Hole> scanner = new ChunkScanner<>();
47
48
    // The holes the neighbour keys were built from.
49
    private List<Hole> known = List.of();
50
    private final LongOpenHashSet keys = new LongOpenHashSet();
51
52
    // The scan settings the cached chunks were built with.
53
    private int lastLayers = -1;
54
    private boolean lastOpen;
55
    private boolean lastRoof;
56
57
    public VoidEsp() {
58
        super("VoidESP", "Shows holes in the bedrock that lead to the void.", Category.RENDER);
59
        addSettings(range, depth, airOnly, netherRoof, connected);
60
        addSettings(floorStyle.settings());
61
        addSettings(roofStyle.settings());
62
        searchTags("void", "bedrock", "roof");
63
    }
64
65
    @Override
66
    public String getSuffix() {
67
        return scanner.size() == 0 ? null : String.valueOf(scanner.size());
68
    }
69
70
    @Override
71
    protected void onEnable() {
72
        forget();
73
    }
74
75
    @Override
76
    protected void onDisable() {
77
        forget();
78
    }
79
80
    private void forget() {
81
        scanner.reset();
82
        known = List.of();
83
        keys.clear();
84
    }
85
86
    @Subscribe
87
    private void onPacketReceive(PacketReceiveEvent event) {
88
        scanner.markChanged(event.getPacket());
89
    }
90
91
    @Subscribe
92
    private void onTick(TickEvent event) {
93
        if (!inGame()) {
94
            return;
95
        }
96
        if (mc.level.dimension() == Level.END) {
97
            scanner.reset();
98
            return;
99
        }
100
        int layers = depth.getInt();
101
        boolean open = airOnly.isOn();
102
        boolean roof = netherRoof.isOn() && mc.level.dimension() == Level.NETHER;
103
        // The scan reads these once a chunk. A change has to throw the cache away.
104
        if (layers != lastLayers || open != lastOpen || roof != lastRoof) {
105
            lastLayers = layers;
106
            lastOpen = open;
107
            lastRoof = roof;
108
            scanner.reset();
109
        }
110
111
        scanner.update(range.getInt(), (view, out) -> {
112
            int baseX = view.pos().getMinBlockX();
113
            int baseZ = view.pos().getMinBlockZ();
114
            int floorY = view.minY();
115
            for (int x = 0; x < 16; x++) {
116
                for (int z = 0; z < 16; z++) {
117
                    int worldX = baseX + x;
118
                    int worldZ = baseZ + z;
119
                    if (isHole(view, worldX, worldZ, floorY, 1, layers, open)) {
120
                        out.add(new Hole(worldX, floorY, worldZ, false));
121
                    }
122
                    if (roof && isHole(view, worldX, worldZ, NETHER_ROOF_Y, -1, layers, open)) {
123
                        out.add(new Hole(worldX, NETHER_ROOF_Y, worldZ, true));
124
                    }
125
                }
126
            }
127
        });
128
    }
129
130
    private static boolean isHole(ChunkScanner.View view, int x, int z, int startY, int step,
131
                                  int layers, boolean airOnly) {
132
        for (int i = 0; i < layers; i++) {
133
            BlockState state = view.get(x, startY + step * i, z);
134
            if (airOnly ? !state.isAir() : state.is(Blocks.BEDROCK)) {
135
                return false;
136
            }
137
        }
138
        return true;
139
    }
140
141
    @Subscribe
142
    private void onRender3D(Render3DEvent event) {
143
        DrawBatch batch = event.getBatch();
144
        List<Hole> holes = scanner.results();
145
        boolean join = connected.isOn();
146
        if (join && holes != known) {
147
            known = holes;
148
            keys.clear();
149
            for (Hole hole : holes) {
150
                keys.add(BlockPos.asLong(hole.x(), hole.y(), hole.z()));
151
            }
152
        }
153
        for (Hole hole : holes) {
154
            AABB box = new AABB(hole.x(), hole.y(), hole.z(),
155
                hole.x() + 1, hole.y() + 1, hole.z() + 1);
156
            BoxStyle style = hole.roof() ? roofStyle : floorStyle;
157
            style.drawJoined(batch, box, join ? DrawBatch.sharedSides(keys, BlockPos.asLong(hole.x(), hole.y(), hole.z())) : 0, true);
158
        }
159
    }
160
}
161
LiquidBounce (Kotlin)RENDERsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/ModuleVoidESP.ktKotlin · 161 lines · 4.9 KB
SettingsYThresholdRangeSideRangeFacing
ModuleVoidESP.ktKotlin · Minecraft 26.2 · 161 lines · 4.9 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.render
20
21
import it.unimi.dsi.fastutil.longs.LongOpenHashSet
22
import it.unimi.dsi.fastutil.longs.LongSet
23
import it.unimi.dsi.fastutil.longs.LongSets
24
import net.ccbluex.liquidbounce.config.ConfigSystem
25
import net.ccbluex.liquidbounce.event.events.PlayerTickEvent
26
import net.ccbluex.liquidbounce.event.handler
27
import net.ccbluex.liquidbounce.features.module.ClientModule
28
import net.ccbluex.liquidbounce.features.module.ModuleCategories
29
import net.ccbluex.liquidbounce.render.engine.type.Color4b
30
import net.ccbluex.liquidbounce.utils.render.placement.PlacementRenderer
31
import net.minecraft.core.BlockPos
32
import net.minecraft.core.Direction
33
import net.minecraft.world.level.block.SupportType
34
import net.minecraft.world.level.chunk.ChunkAccess
35
36
/**
37
 * VoidESP module
38
 *
39
 * Highlight all surrounding positions that may be void.
40
 */
41
42
object ModuleVoidESP : ClientModule("VoidESP", ModuleCategories.RENDER) {
43
44
    override val baseKey: String
45
        get() = "${ConfigSystem.KEY_PREFIX}.module.voidEsp"
46
47
    private val yThreshold by int("YThreshold", 16, 3..32)
48
    private val rangeSide by int("RangeSide", 3, 0..32)
49
    private val rangeFacing by int("RangeFacing", 8, 1..32)
50
51
    private val renderer = tree(
52
        PlacementRenderer("Render", true, this, keep = true,
53
            defaultColor = Color4b(255, 0, 0, 90)
54
        )
55
    )
56
57
    private var lastTickPositions: LongSet = LongSets.EMPTY_SET
58
59
    override fun onDisabled() {
60
        lastTickPositions = LongSets.EMPTY_SET
61
        renderer.clearSilently()
62
    }
63
64
    private val posStart = BlockPos.MutableBlockPos()
65
    private val posEnd = BlockPos.MutableBlockPos()
66
67
    private fun ChunkAccess.canBlockStandOn(pos: BlockPos): Boolean {
68
        return this.getBlockState(pos).isFaceSturdy(this, pos, Direction.UP, SupportType.CENTER)
69
    }
70
71
    /**
72
     * Search positions around.
73
     */
74
    private fun search(): LongSet {
75
        val positions = LongOpenHashSet()
76
77
        // Find the first place where the player can stand
78
        val startPos = posEnd.setWithOffset(player.blockPosition(), Direction.DOWN)
79
        val yThreshold = yThreshold
80
        var chunk = world.getChunk(startPos)
81
        var flag = false
82
83
        var i = 0
84
        while (i++ < yThreshold) {
85
            if (chunk.canBlockStandOn(startPos)) {
86
                flag = true
87
                break
88
            }
89
            startPos.y--
90
        }
91
92
        if (!flag) {
93
            return LongSets.EMPTY_SET
94
        }
95
96
        val facing = player.direction
97
        val side = facing.clockWise
98
99
        val from = posStart.set(startPos)
100
            .move(facing, rangeFacing).move(side.opposite, rangeSide)
101
        val to = posEnd.set(startPos)
102
            .move(facing.opposite, rangeFacing).move(side, rangeSide)
103
104
        BlockPos.betweenClosed(from, to).forEach {
105
            chunk = world.getChunk(it)
106
107
            if (chunk.canBlockStandOn(it)) {
108
                return@forEach
109
            }
110
111
            posStart.set(it)
112
113
            repeat(yThreshold) { _ ->
114
                posStart.y--
115
116
                if (chunk.canBlockStandOn(posStart)) {
117
                    return@forEach
118
                }
119
120
                // Reach the bottom(void)
121
                if (posStart.y <= chunk.minY) {
122
                    positions.add(it.asLong())
123
                    return@forEach
124
                }
125
            }
126
127
            positions.add(it.asLong())
128
        }
129
130
        return positions
131
    }
132
133
    private val tickHandler = handler<PlayerTickEvent> {
134
        val positions = search()
135
136
        // Invalidate last tick positions
137
        with(lastTickPositions.longIterator()) {
138
            while (hasNext()) {
139
                val longValue = nextLong()
140
                if (longValue !in positions) {
141
                    renderer.removeBlock(posStart.set(longValue))
142
                }
143
            }
144
        }
145
146
        // Add this tick positions
147
        with(positions.longIterator()) {
148
            while (hasNext()) {
149
                val longValue = nextLong()
150
                renderer.addBlock(posStart.set(longValue))
151
            }
152
        }
153
154
        lastTickPositions = positions
155
156
        // Update cull data
157
        renderer.updateAll()
158
    }
159
160
}
161