Plugins module

Plugins: 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/exploit/ModulePlugins.ktKotlin · 111 lines · 4.2 KB

Attempts to list all plugins installed on the server.

SettingsTry
ModulePlugins.ktKotlin · Minecraft 26.2 · 111 lines · 4.2 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 kotlinx.coroutines.delay
22
import net.ccbluex.liquidbounce.config.types.list.Tagged
23
import net.ccbluex.liquidbounce.event.events.ChatReceiveEvent
24
import net.ccbluex.liquidbounce.event.waitMatchesWithTimeout
25
import net.ccbluex.liquidbounce.features.module.ClientModule
26
import net.ccbluex.liquidbounce.features.module.ModuleCategories
27
import net.ccbluex.liquidbounce.utils.client.ServerObserver
28
import net.ccbluex.liquidbounce.utils.client.chat
29
import net.ccbluex.liquidbounce.utils.text.joinToText
30
import net.ccbluex.liquidbounce.utils.client.markAsError
31
import net.ccbluex.liquidbounce.utils.client.regular
32
import net.ccbluex.liquidbounce.utils.client.variable
33
import net.ccbluex.liquidbounce.utils.kotlin.EventPriorityConvention.FIRST_PRIORITY
34
import kotlin.time.Duration.Companion.seconds
35
36
/**
37
 * Plugins module
38
 *
39
 * Allows you to see a server's plugins.
40
 */
41
object ModulePlugins : ClientModule("Plugins", ModuleCategories.EXPLOIT, disableOnQuit = true) {
42
43
    private val tryState by multiEnumChoice("Try", TryState.entries)
44
45
    override suspend fun enabledEffect() {
46
        // Works only on servers that did not block the plugins command.
47
        if (TryState.SLASH in tryState) {
48
            network.sendCommand("plugins")
49
            val event = waitPluginsMessage()
50
51
            if (event == null) {
52
                delay(1.seconds)
53
            } else {
54
                enabled = false
55
                return
56
            }
57
        }
58
59
        // Use bukkit:plugins to get plugins, this might work on some servers if they blocked the plugins command.
60
        if (TryState.COLON_SLASH in tryState) {
61
            network.sendCommand("bukkit:plugins")
62
            val event = waitPluginsMessage()
63
64
            if (event == null) {
65
                delay(1.seconds)
66
            } else {
67
                enabled = false
68
                return
69
            }
70
        }
71
72
        // Exploits tab completion to get plugins - this will not show all of them, but it will show some.
73
        if (TryState.TAB_COMPLETE in tryState) {
74
            // Timeout after 5 seconds.
75
            if (ServerObserver.captureCommandSuggestions(5.seconds)) {
76
                val plugins = ServerObserver.formattedPluginList!!
77
                chat(regular(message(
78
                    "plugins",
79
                    variable(plugins.size.toString()),
80
                    plugins.joinToText(separator = regular(", ")))
81
                ))
82
            } else {
83
                chat(markAsError(message("noPluginsFound")))
84
            }
85
            enabled = false
86
            return
87
        }
88
89
        // If none of the methods worked out, disable the module.
90
        chat(message("timeOut"))
91
        enabled = false
92
    }
93
94
    private suspend fun waitPluginsMessage() =
95
        waitMatchesWithTimeout<ChatReceiveEvent>(timeout = 5.seconds, priority = FIRST_PRIORITY) {
96
            // Only handle game messages. It is unlikely that any server will use a player for the chat game.
97
            it.type == ChatReceiveEvent.ChatType.GAME_MESSAGE &&
98
                // Server has already responded with a list of plugins.
99
                it.message.contains("Plugins (")
100
101
            // Sadly we cannot use the takeInput here, because we cannot cancel the message with this event.
102
            // Might change this in the future.
103
        }
104
105
    private enum class TryState(override val tag: String) : Tagged {
106
        SLASH("Slash"),
107
        COLON_SLASH("ColonSlash"),
108
        TAB_COMPLETE("TabComplete")
109
    }
110
}
111