ClickTP module

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

3 implementationsMOVEMENTEXPLOIT

Full module source: 3 implementations

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

MelaHack (ThunderHack fork)MOVEMENTsrc/main/java/thunder/hack/features/modules/movement/ClickTP.javaJava · 54 lines · 2.2 KB
SettingsBlockOffsetSpoofsGround
ClickTP.javaJava · Minecraft 26.2 · 54 lines · 2.2 KB · complete file, verbatimOriginal ↗
1
package thunder.hack.features.modules.movement;
2
3
import com.mojang.blaze3d.vertex.PoseStack;
4
import meteordevelopment.orbit.EventHandler;
5
import net.minecraft.core.BlockPos;
6
import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket;
7
import net.minecraft.world.phys.AABB;
8
import net.minecraft.world.phys.BlockHitResult;
9
import net.minecraft.world.phys.HitResult;
10
import net.minecraft.world.phys.Vec3;
11
import thunder.hack.events.impl.EventSync;
12
import thunder.hack.features.modules.Module;
13
import thunder.hack.features.modules.client.HudEditor;
14
import thunder.hack.setting.Setting;
15
import thunder.hack.utility.render.Render3DEngine;
16
17
public class ClickTP extends Module {
18
    public ClickTP() {
19
        super("ClickTP", Category.MOVEMENT);
20
    }
21
22
    private final Setting<Float> blockOffset = new Setting<>("BlockOffset", 1.0f, -1f, 1f);
23
    private final Setting<Integer> spoofs = new Setting<>("Spoofs", 0, 0, 40);
24
    private final Setting<Boolean> ground = new Setting<>("Ground", false);
25
26
    private int delay;
27
28
    @EventHandler
29
    public void onSync(EventSync e) {
30
        if (delay >= 0)
31
            delay--;
32
33
        if (mc.options.keyPickItem.isDown() && delay < 0) {
34
            HitResult ray = mc.player.pick(256, Render3DEngine.getTickDelta(), false);
35
            if (ray instanceof BlockHitResult bhr && !mc.level.isEmptyBlock(bhr.getBlockPos())) {
36
                Vec3 pos = net.minecraft.world.phys.Vec3.atBottomCenterOf(bhr.getBlockPos());
37
                for (int i = 0; i < spoofs.getValue(); ++i)
38
                    sendPacket(new ServerboundMovePlayerPacket.Pos(pos.x(), pos.y() + blockOffset.getValue(), pos.z(), ground.getValue(), mc.player.horizontalCollision));
39
                mc.player.setPos(pos.x(), pos.y() + blockOffset.getValue(), pos.z());
40
                delay = 5;
41
            }
42
        }
43
    }
44
45
    @Override
46
    public void onRender3D(PoseStack stack) {
47
        HitResult ray = mc.player.pick(256, Render3DEngine.getTickDelta(), false);
48
        if (ray instanceof BlockHitResult bhr && !mc.level.isEmptyBlock(bhr.getBlockPos())) {
49
            BlockPos pos = bhr.getBlockPos();
50
            Render3DEngine.OUTLINE_QUEUE.add(new Render3DEngine.OutlineAction(new AABB(pos), HudEditor.getColor(1), 1));
51
        }
52
    }
53
}
54
OfflineClientMOVEMENTsrc/main/java/com/jellypudding/offlineclient/modules/movement/ClickTp.javaJava · 139 lines · 5.0 KB

Teleports you to the block you right click.

SettingsRange
ClickTp.javaJava · Minecraft 26.2 · 139 lines · 5.0 KB · complete file, verbatimOriginal ↗
1
package com.jellypudding.offlineclient.modules.movement;
2
3
import com.jellypudding.offlineclient.event.Subscribe;
4
import com.jellypudding.offlineclient.event.events.TickEvent;
5
import com.jellypudding.offlineclient.module.Category;
6
import com.jellypudding.offlineclient.module.Module;
7
import com.jellypudding.offlineclient.setting.NumberSetting;
8
import net.minecraft.client.Camera;
9
import net.minecraft.core.BlockPos;
10
import net.minecraft.core.Direction;
11
import net.minecraft.network.protocol.game.ServerboundMovePlayerPacket;
12
import net.minecraft.world.InteractionResult;
13
import net.minecraft.world.item.BlockItem;
14
import net.minecraft.world.item.ItemUseAnimation;
15
import net.minecraft.world.level.ClipContext;
16
import net.minecraft.world.level.block.state.BlockState;
17
import net.minecraft.world.phys.BlockHitResult;
18
import net.minecraft.world.phys.HitResult;
19
import net.minecraft.world.phys.Vec3;
20
import net.minecraft.world.phys.shapes.VoxelShape;
21
22
// Teleports you onto the block you right click. The server only grants a little
23
// movement per packet each tick. A long trip is walked as one hop a tick.
24
public final class ClickTp extends Module {
25
26
    // Three fillers then the hop itself. The fifth is left for the client's own packet.
27
    private static final int FILLER_PACKETS = 3;
28
29
    // The fourth packet allows four hundred squared blocks which is twenty of travel.
30
    private static final double MAX_HOP = 19.9;
31
32
    private final NumberSetting range = new NumberSetting("Range",
33
        "How far away the clicked block may be.", 100, 10, 200, 10, " blocks");
34
35
    // Where the current trip ends. Null whilst there is no trip.
36
    private Vec3 destination;
37
38
    public ClickTp() {
39
        super("ClickTp", "Teleports you to the block you right click.", Category.MOVEMENT);
40
        addSettings(range);
41
        searchTags("teleport", "click teleport");
42
    }
43
44
    @Override
45
    protected void onEnable() {
46
        destination = null;
47
    }
48
49
    @Override
50
    protected void onDisable() {
51
        destination = null;
52
    }
53
54
    @Subscribe
55
    private void onTick(TickEvent event) {
56
        if (!inGame() || mc.player.isDeadOrDying()) {
57
            destination = null;
58
            return;
59
        }
60
        if (destination != null) {
61
            hop();
62
            return;
63
        }
64
        if (!mc.options.keyUse.isDown() || mc.gui.screen() != null) {
65
            return;
66
        }
67
        if (mc.player.getMainHandItem().getUseAnimation() != ItemUseAnimation.NONE) {
68
            return;
69
        }
70
        if (busyWithTarget()) {
71
            return;
72
        }
73
        BlockHitResult hit = lookRay();
74
        if (hit.getType() != HitResult.Type.BLOCK) {
75
            return;
76
        }
77
        BlockPos pos = hit.getBlockPos();
78
        BlockState state = mc.level.getBlockState(pos);
79
        if (state.useWithoutItem(mc.level, mc.player, hit) != InteractionResult.PASS) {
80
            return;
81
        }
82
        VoxelShape shape = state.getCollisionShape(mc.level, pos);
83
        if (shape.isEmpty()) {
84
            shape = state.getShape(mc.level, pos);
85
        }
86
        double top = shape.isEmpty() ? 1 : shape.max(Direction.Axis.Y);
87
        Direction side = hit.getDirection();
88
        destination = new Vec3(pos.getX() + 0.5 + side.getStepX(), pos.getY() + top,
89
            pos.getZ() + 0.5 + side.getStepZ());
90
        hop();
91
    }
92
93
    // A use on an entity or a block placement keeps its normal meaning.
94
    private boolean busyWithTarget() {
95
        HitResult hit = mc.hitResult;
96
        if (hit == null) {
97
            return false;
98
        }
99
        if (hit.getType() == HitResult.Type.ENTITY) {
100
            return true;
101
        }
102
        return hit.getType() == HitResult.Type.BLOCK
103
            && mc.player.getMainHandItem().getItem() instanceof BlockItem;
104
    }
105
106
    private BlockHitResult lookRay() {
107
        Camera camera = mc.gameRenderer.mainCamera();
108
        Vec3 from = camera.position();
109
        Vec3 to = from.add(Vec3.directionFromRotation(camera.xRot(), camera.yRot())
110
            .scale(range.getValue()));
111
        return mc.level.clip(new ClipContext(from, to, ClipContext.Block.OUTLINE,
112
            ClipContext.Fluid.NONE, mc.player));
113
    }
114
115
    // Moves as far along the trip as one tick of packets is allowed to carry.
116
    private void hop() {
117
        Vec3 from = mc.player.position();
118
        double left = from.distanceTo(destination);
119
        boolean arriving = left <= MAX_HOP;
120
        Vec3 step = arriving
121
            ? destination
122
            : from.add(destination.subtract(from).scale(MAX_HOP / left));
123
124
        for (int i = 0; i < FILLER_PACKETS; i++) {
125
            mc.player.connection.send(new ServerboundMovePlayerPacket.StatusOnly(true, true));
126
        }
127
        mc.player.connection.send(new ServerboundMovePlayerPacket.Pos(step, true, true));
128
        mc.player.setPos(step);
129
        // The rest of the tick still runs the physics. Gravity between hops would
130
        // otherwise gather into a fall the landing has to pay for.
131
        mc.player.setDeltaMovement(Vec3.ZERO);
132
        mc.player.fallDistance = 0;
133
134
        if (arriving) {
135
            destination = null;
136
        }
137
    }
138
}
139
LiquidBounce (Kotlin)EXPLOITsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/exploit/ModuleClickTp.ktKotlin · 222 lines · 7.3 KB

Teleports you to the block you are looking at when pressing MIDDLE_CLICK. Only works on Vulcan 286 anti-cheat.

SettingsRangeCooldownLagAfterJumpsStartDelay
ModuleClickTp.ktKotlin · Minecraft 26.2 · 222 lines · 7.3 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
20
package net.ccbluex.liquidbounce.features.module.modules.exploit
21
22
import net.ccbluex.liquidbounce.event.events.BlinkPacketEvent
23
import net.ccbluex.liquidbounce.event.events.BlockShapeEvent
24
import net.ccbluex.liquidbounce.event.events.MovementInputEvent
25
import net.ccbluex.liquidbounce.event.events.NotificationEvent
26
import net.ccbluex.liquidbounce.event.events.TransferOrigin
27
import net.ccbluex.liquidbounce.event.events.WorldRenderEvent
28
import net.ccbluex.liquidbounce.event.handler
29
import net.ccbluex.liquidbounce.event.tickHandler
30
import net.ccbluex.liquidbounce.event.tickUntil
31
import net.ccbluex.liquidbounce.event.waitTicks
32
import net.ccbluex.liquidbounce.features.blink.BlinkManager
33
import net.ccbluex.liquidbounce.features.module.ClientModule
34
import net.ccbluex.liquidbounce.features.module.ModuleCategories
35
import net.ccbluex.liquidbounce.render.FULL_BOX
36
import net.ccbluex.liquidbounce.render.drawBoxSide
37
import net.ccbluex.liquidbounce.render.drawGradientSides
38
import net.ccbluex.liquidbounce.render.engine.type.Color4b
39
import net.ccbluex.liquidbounce.render.renderEnvironment
40
import net.ccbluex.liquidbounce.render.withPositionRelativeToCamera
41
import net.ccbluex.liquidbounce.utils.block.canStandOn
42
import net.ccbluex.liquidbounce.utils.block.state
43
import net.ccbluex.liquidbounce.utils.client.chat
44
import net.ccbluex.liquidbounce.utils.client.markAsError
45
import net.ccbluex.liquidbounce.utils.client.notification
46
import net.ccbluex.liquidbounce.utils.entity.rotation
47
import net.ccbluex.liquidbounce.utils.math.bottomCenter
48
import net.ccbluex.liquidbounce.utils.movement.DirectionalInput
49
import net.ccbluex.liquidbounce.utils.raytracing.traceFromPlayer
50
import net.minecraft.core.BlockPos
51
import net.minecraft.core.Direction
52
import net.minecraft.world.level.block.LiquidBlock
53
import net.minecraft.world.level.block.RenderShape
54
import net.minecraft.world.phys.Vec3
55
import net.minecraft.world.phys.shapes.Shapes
56
57
/**
58
 * ClickTP
59
 *
60
 * Only works for Vulcan AntiCheat
61
 */
62
object ModuleClickTp : ClientModule("ClickTp", ModuleCategories.EXPLOIT, aliases = listOf("ClickTeleport")) {
63
64
    private val range by float("Range", 60f, 10f..500f)
65
    private val cooldown by int("Cooldown", 20, 0..120)
66
    private val lagAfter by int("LagAfter", 40, 0..120)
67
    private val jumps by int("Jumps", 3, 1..10)
68
69
    private val startDelay by int("StartDelay", 5, 0..20)
70
71
    private var requiresLag = false
72
    private var requiresCollision = false
73
    private var requiresMovement = false
74
75
    private var highlightBlock: BlockPos? = null
76
77
    @Suppress("unused")
78
    private val tickHandler = tickHandler {
79
        val raycast = traceFromPlayer(player.rotation, range = range.toDouble())
80
        val blockPos = raycast?.blockPos.apply {
81
            highlightBlock = this
82
        }
83
84
        if (!mc.options.keyPickItem.isDown) {
85
            return@tickHandler
86
        }
87
88
        if (blockPos == null) {
89
            chat(markAsError(message("noSelection")))
90
            return@tickHandler
91
        }
92
93
        if (!isSuitable(blockPos)) {
94
            chat(markAsError(message("noSuitableBlock", blockPos.x, blockPos.y, blockPos.z)))
95
            return@tickHandler
96
        }
97
98
        val pos = blockPos.bottomCenter(yOffset = 1.5)
99
100
        notification(
101
            "ClickTp", message("start", blockPos.x, blockPos.y, blockPos.z),
102
            NotificationEvent.Severity.SUCCESS
103
        )
104
105
        teleportVulcan286(pos)
106
107
        waitTicks(5)
108
        if (blockPos.distToCenterSqr(player.position()) < 5) {
109
            notification(
110
                "ClickTp", message("success", blockPos.x, blockPos.y, blockPos.z),
111
                NotificationEvent.Severity.SUCCESS
112
            )
113
        } else {
114
            notification(
115
                "ClickTp", message("failed", blockPos.x, blockPos.y, blockPos.z),
116
                NotificationEvent.Severity.ERROR
117
            )
118
        }
119
120
        waitTicks(cooldown)
121
    }
122
123
    /**
124
     * Teleport to a position by abusing Vulcan.
125
     */
126
    private suspend fun teleportVulcan286(pos: Vec3) {
127
        requiresLag = true
128
129
        // Set position and send packet
130
        player.setPos(pos)
131
        waitTicks(startDelay)
132
133
        repeat(jumps) {
134
            requiresCollision = true
135
            player.jumpFromGround()
136
137
            waitTicks(1)
138
            tickUntil { player.onGround() }
139
            requiresCollision = false
140
        }
141
142
        requiresMovement = true
143
        waitTicks(lagAfter)
144
        requiresMovement = false
145
146
        requiresLag = false
147
    }
148
149
    @Suppress("unused")
150
    val renderHandler = handler<WorldRenderEvent> { event ->
151
        val position = highlightBlock ?: return@handler
152
        val state = position.state ?: return@handler
153
154
        if (state.renderShape != RenderShape.MODEL || state.isAir) {
155
            return@handler
156
        }
157
158
        event.renderEnvironment {
159
            val color = if (isSuitable(position)) {
160
                Color4b(0x20, 0xC2, 0x06)
161
            } else {
162
                Color4b(0xD7, 0x09, 0x09)
163
            }
164
165
            val baseColor = color.with(a = 50)
166
            val transparentColor = baseColor.with(a = 0)
167
            val outlineColor = color.with(a = 200)
168
169
            withPositionRelativeToCamera(position.above()) {
170
                drawBoxSide(
171
                    FULL_BOX,
172
                    Direction.DOWN,
173
                    baseColor,
174
                    outlineColor,
175
                )
176
                drawGradientSides(0.7, baseColor, transparentColor, FULL_BOX)
177
            }
178
        }
179
    }
180
181
    @Suppress("unused")
182
    val shapeHandler = handler<BlockShapeEvent> { event ->
183
        if (requiresCollision && event.state.block !is LiquidBlock && event.pos.y < player.y) {
184
            event.shape = Shapes.block()
185
        }
186
    }
187
188
    private var swap = false
189
190
    @Suppress("unused")
191
    val handleMovement = handler<MovementInputEvent> {
192
        if (requiresMovement) {
193
            it.directionalInput = if (swap) DirectionalInput.LEFT else DirectionalInput.RIGHT
194
            swap = !swap
195
        }
196
    }
197
198
    @Suppress("unused")
199
    private val fakeLagHandler = handler<BlinkPacketEvent> { event ->
200
        if (event.origin == TransferOrigin.OUTGOING && requiresLag) {
201
            event.action = BlinkManager.Action.QUEUE
202
        }
203
    }
204
205
    private fun isSuitable(blockPos: BlockPos?): Boolean {
206
        if (blockPos == null || !blockPos.canStandOn()) {
207
            return false
208
        }
209
210
        return !blockPos.above().canStandOn() && !blockPos.above(2).canStandOn()
211
    }
212
213
    override fun onDisabled() {
214
        requiresLag = false
215
        requiresCollision = false
216
        requiresMovement = false
217
        highlightBlock = null
218
        super.onDisabled()
219
    }
220
221
}
222