Teleport module

Teleport: Minecraft 26.3 cheat module, full source for every implementation (1 client: LiquidBounce (Kotlin)).

1 implementationEXPLOIT

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.

LiquidBounce (Kotlin)EXPLOITsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/movement/ModuleTeleport.ktKotlin · 191 lines · 6.8 KB

Configuration for the Teleport command (.tp).

SettingsAllFullPacketPaperBypassHighTPHighTPAmountGroundModeResetMotionFunctionAfterTeleportsWithDisablerOnWait
ModuleTeleport.ktKotlin · Minecraft 26.2 · 191 lines · 6.8 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.movement
21
22
import net.ccbluex.liquidbounce.config.types.list.Tagged
23
import net.ccbluex.liquidbounce.event.events.PacketEvent
24
import net.ccbluex.liquidbounce.event.handler
25
import net.ccbluex.liquidbounce.features.command.commands.module.teleport.CommandPlayerTeleport
26
import net.ccbluex.liquidbounce.features.command.commands.module.teleport.CommandTeleport
27
import net.ccbluex.liquidbounce.features.command.commands.module.teleport.CommandVClip
28
import net.ccbluex.liquidbounce.features.module.ClientModule
29
import net.ccbluex.liquidbounce.features.module.ModuleCategories
30
import net.ccbluex.liquidbounce.features.module.modules.exploit.disabler.ModuleDisabler
31
import net.ccbluex.liquidbounce.utils.network.MovePacketType
32
import net.ccbluex.liquidbounce.utils.client.chat
33
import net.ccbluex.liquidbounce.utils.client.regular
34
import net.ccbluex.liquidbounce.utils.network.sendPacketSilently
35
import net.ccbluex.liquidbounce.utils.client.variable
36
import net.ccbluex.liquidbounce.utils.client.warning
37
import net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket
38
import net.minecraft.world.phys.Vec3
39
import java.text.DecimalFormat
40
import kotlin.math.abs
41
import kotlin.math.floor
42
43
/**
44
 * Teleport Module
45
 *
46
 * Configuration for teleport commands.
47
 *
48
 * Commands: [CommandVClip], [CommandTeleport], [CommandPlayerTeleport]
49
 */
50
object ModuleTeleport : ClientModule("Teleport", ModuleCategories.EXPLOIT, aliases = listOf("tp")) {
51
52
    private val allFull by boolean("AllFullPacket", false)
53
    private val paperExploit by boolean("PaperBypass", false)
54
    val highTp by boolean("HighTP", false)
55
    val highTpAmount by float("HighTPAmount", 200.0F, 0.0F..500.0F)
56
    private val groundMode by enumChoice("GroundMode", GroundMode.CORRECT)
57
    private val resetMotion by boolean("ResetMotion", true)
58
59
    private val functionAfterServerTeleport by int("FunctionAfterTeleports", 0, 0..5)
60
    private val withDisabler by boolean("WithDisablerOnWait", false)
61
62
    private val decimalFormat = DecimalFormat("##0.000")
63
64
    enum class GroundMode(override val tag: String) : Tagged {
65
        TRUE("True"),
66
        FALSE("False"),
67
        CORRECT("Correct")
68
    }
69
70
    private var indicatedTeleport: Vec3? = null
71
    private var teleportsToWait: Int = 0
72
73
    override fun onEnabled() {
74
        if (indicatedTeleport == null) {
75
            chat(warning(message("useCommand")))
76
77
            // Disables module on next render tick
78
            mc.execute {
79
                this.enabled = false
80
            }
81
        }
82
    }
83
84
    override fun onDisabled() {
85
        indicatedTeleport = null
86
        teleportsToWait = 0
87
    }
88
89
    fun indicateTeleport(x: Double = player.x, y: Double = player.y, z: Double = player.z) {
90
        if (functionAfterServerTeleport == 0) {
91
            teleport(x, y, z)
92
            return
93
        }
94
95
        this.indicatedTeleport = Vec3(x, y, z)
96
        this.teleportsToWait = functionAfterServerTeleport
97
        this.enabled = true
98
99
        if (teleportsToWait == 1 && withDisabler) {
100
            ModuleDisabler.enabled = true
101
        }
102
103
        chat(variable(message("teleportsLeft", teleportsToWait)))
104
    }
105
106
    @Suppress("unused")
107
    private val packetHandler = handler<PacketEvent> {
108
        if (it.packet is ClientboundPlayerPositionPacket) {
109
            val indicatedTeleport = indicatedTeleport ?: return@handler
110
111
            if (teleportsToWait > 1) {
112
                teleportsToWait--
113
                chat(variable(message("teleportsLeft", teleportsToWait)))
114
                return@handler
115
            }
116
117
            sendPacketSilently(MovePacketType.FULL.generatePacket().apply {
118
                val change = it.packet.change
119
                this.x = change.position.x
120
                this.y = change.position.y
121
                this.z = change.position.z
122
                this.yRot = change.yRot
123
                this.xRot = change.xRot
124
                this.onGround = false
125
            })
126
127
            teleport(indicatedTeleport.x, indicatedTeleport.y, indicatedTeleport.z)
128
            this.indicatedTeleport = null
129
            it.cancelEvent()
130
131
            if (withDisabler) {
132
                ModuleDisabler.enabled = false
133
            }
134
        }
135
    }
136
137
    fun teleport(x: Double = player.x, y: Double = player.y, z: Double = player.z) {
138
        if (paperExploit) {
139
            val deltaX = x - player.x
140
            val deltaY = y - player.y
141
            val deltaZ = z - player.z
142
143
            val times = (floor((abs(deltaX) + abs(deltaY) + abs(deltaZ)) / 10) - 1).toInt()
144
            val packetToSend = if (allFull) MovePacketType.FULL else MovePacketType.POSITION_AND_ON_GROUND
145
            repeat(times) {
146
                network.send(packetToSend.generatePacket().apply {
147
                    this.x = player.x
148
                    this.y = player.y
149
                    this.z = player.z
150
                    this.yRot = player.yRot
151
                    this.xRot = player.xRot
152
                    this.onGround = when (groundMode) {
153
                        GroundMode.TRUE -> true
154
                        GroundMode.FALSE -> false
155
                        GroundMode.CORRECT -> player.onGround()
156
                    }
157
                })
158
            }
159
160
            network.send(packetToSend.generatePacket().apply {
161
                this.x = x
162
                this.y = y
163
                this.z = z
164
                this.yRot = player.yRot
165
                this.xRot = player.xRot
166
                this.onGround = when (groundMode) {
167
                    GroundMode.TRUE -> true
168
                    GroundMode.FALSE -> false
169
                    GroundMode.CORRECT -> player.onGround()
170
                }
171
            })
172
        }
173
174
        val entity = player.vehicle ?: player
175
        entity.absSnapTo(x, y, z)
176
177
        if (resetMotion) {
178
            entity.deltaMovement = entity.deltaMovement.multiply(0.0, 0.0, 0.0)
179
        }
180
181
        chat(regular(
182
            message("teleported",
183
            variable(decimalFormat.format(x)),
184
            variable(decimalFormat.format(y)),
185
            variable(decimalFormat.format(z)))
186
        ))
187
        this.enabled = false
188
    }
189
190
}
191