ClickGUI module

ClickGUI: Minecraft 26.3 cheat module, full source for every implementation (4 clients: OfflineClient, Combatant, KiwiClient, …).

4 implementationsMISCCLIENTRENDER

Full module source: 4 implementations

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

OfflineClientMISCsrc/main/java/com/jellypudding/offlineclient/modules/misc/ClickGuiModule.javaJava · 99 lines · 3.4 KB

Opens the GUI and sets its accent colour.

SettingsStyleHover helpAccentBackgroundTextOpacityTitle colourVersion colour
ClickGuiModule.javaJava · Minecraft 26.2 · 99 lines · 3.4 KB · complete file, verbatimOriginal ↗
1
package com.jellypudding.offlineclient.modules.misc;
2
3
import com.jellypudding.offlineclient.gui.ClickGuiScreen;
4
import com.jellypudding.offlineclient.gui.WindowGuiScreen;
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.ColorSetting;
9
import com.jellypudding.offlineclient.setting.EnumSetting;
10
import com.jellypudding.offlineclient.setting.NumberSetting;
11
import net.minecraft.client.gui.screens.Screen;
12
import org.lwjgl.glfw.GLFW;
13
14
public final class ClickGuiModule extends Module {
15
16
    public enum Style { PANELS, WINDOW }
17
18
    private final EnumSetting<Style> style = new EnumSetting<>("Style",
19
        "How the GUI is laid out.", Style.PANELS)
20
        .describe(Style.PANELS, "A draggable panel for each category.")
21
        .describe(Style.WINDOW, "One window with a category sidebar.");
22
23
    private final BoolSetting hoverHelp = new BoolSetting("Hover help",
24
        "Explains a module or setting whilst you hover over it.", true);
25
    private final ColorSetting accent = new ColorSetting("Accent",
26
        "Main colour of the GUI and HUD.", 190, false);
27
    private final ColorSetting background = new ColorSetting("Background",
28
        "Colour the panels and rows are shaded from.", 240, 0.40625f, 0.1254902f, false);
29
    private final ColorSetting text = new ColorSetting("Text",
30
        "Colour the writing is shaded from.", 240, 0.0327869f, 0.9568627f, false);
31
    private final NumberSetting opacity = new NumberSetting("Opacity",
32
        "How solid the panels are.", 100, 15, 100, 1, "%").min(5).max(100);
33
    // Nearly white and a faint grey. The same shades the theme text uses.
34
    private final ColorSetting titleColor = new ColorSetting("Title colour",
35
        "Colour of the client name at the top of the window.", 240, 0.03f, 0.96f, false)
36
        .under(style, Style.WINDOW);
37
    private final ColorSetting versionColor = new ColorSetting("Version colour",
38
        "Colour of the version number next to it.", 232, 0.2f, 0.55f, false)
39
        .under(style, Style.WINDOW);
40
41
    public ClickGuiModule() {
42
        super("ClickGUI", "Opens the GUI and sets its accent colour.",
43
            Category.MISC, GLFW.GLFW_KEY_RIGHT_SHIFT);
44
        addSettings(style, hoverHelp, accent, background, text, opacity,
45
            titleColor, versionColor);
46
    }
47
48
    public int titleColor() {
49
        return titleColor.getColor();
50
    }
51
52
    public int versionColor() {
53
        return versionColor.getColor();
54
    }
55
56
    public boolean showsHoverHelp() {
57
        return hoverHelp.isOn();
58
    }
59
60
    @Override
61
    public boolean isTogglable() {
62
        return false;
63
    }
64
65
    public ColorSetting getAccent() {
66
        return accent;
67
    }
68
69
    public int background() {
70
        return background.getColor();
71
    }
72
73
    public int textColor() {
74
        return text.getColor();
75
    }
76
77
    // A share from nought to one.
78
    public float opacity() {
79
        return opacity.getFloat() / 100f;
80
    }
81
82
    public boolean isWindow() {
83
        return style.is(Style.WINDOW);
84
    }
85
86
    @Override
87
    public void onKeybind() {
88
        open();
89
    }
90
91
    // A screen opened mid key press receives that same press.
92
    public void open() {
93
        mc.schedule(() -> {
94
            Screen screen = isWindow() ? new WindowGuiScreen() : new ClickGuiScreen();
95
            mc.gui.setScreen(screen);
96
        });
97
    }
98
}
99
CombatantMISCsrc/main/java/combatant/client/features/module/modules/misc/ClickGui.javaJava · 110 lines · 3.8 KB
Settingsgui_soundsgui_sound_volume
ClickGui.javaJava · Minecraft 26.2 · 110 lines · 3.8 KB · complete file, verbatimOriginal ↗
1
/*
2
 * This file is part of the Combatant Client distribution.
3
 * Copyright (c) 2026 pivosos2007.
4
 *
5
 * Licensed under the GNU General Public License v3.0.
6
 */
7
8
package combatant.client.features.module.modules.misc;
9
10
import combatant.client.config.DisableSettingI18n;
11
import combatant.client.config.values.BooleanMapValue;
12
import combatant.client.config.values.NumberValue;
13
import combatant.client.features.gui.clickgui.ClickGuiEditorScreen;
14
import combatant.client.features.gui.clickgui.ClickGuiPickerScreen;
15
import combatant.client.features.gui.clickgui.ClickGuiRenderer;
16
import combatant.client.features.gui.clickgui.ClickGuiScreen;
17
import combatant.client.features.module.Module;
18
import combatant.client.features.module.ModuleCategory;
19
import combatant.client.features.module.ModuleInfo;
20
import combatant.client.util.screen.ClientScreen;
21
import combatant.client.features.gui.clickgui.sound.GuiSound;
22
import net.minecraft.client.Minecraft;
23
24
import java.util.LinkedHashMap;
25
import java.util.Map;
26
27
@ModuleInfo(id = "clickgui", displayName = "ClickGUI", aliases = {"menu", "settings"}, category = ModuleCategory.MISC)
28
public class ClickGui extends Module {
29
    private static boolean suppressScreenClose = false;
30
31
    @DisableSettingI18n(name = false, options = true)
32
    private final BooleanMapValue guiSoundToggles = group("gui_sounds", defaultGuiSounds());
33
    private final NumberValue<Double> guiSoundVolume = num("gui_sound_volume", 0.75, 0.0, 2.0);
34
35
    {
36
        setDefaultBind("RIGHT_SHIFT");
37
    }
38
39
    public static boolean isSuppressScreenClose() {
40
        return suppressScreenClose;
41
    }
42
43
    public static void setSuppressScreenClose(boolean suppress) {
44
        suppressScreenClose = suppress;
45
    }
46
47
    private static Map<String, Boolean> defaultGuiSounds() {
48
        Map<String, Boolean> out = new LinkedHashMap<>();
49
        out.put("button", true);
50
        out.put("buttonyes", true);
51
        out.put("boolean_on", true);
52
        out.put("boolean_off", true);
53
        out.put("guibinding", true);
54
        out.put("guibindingnull", true);
55
        out.put("guibindingstart", true);
56
        out.put("guibindreset", true);
57
        out.put("guichangemode", true);
58
        out.put("gui_open", true);
59
        out.put("gui_close", true);
60
        out.put("guicoloropen", true);
61
        out.put("guicolorselect", true);
62
        out.put("guimodulehover", true);
63
        out.put("moduleopen", true);
64
        out.put("moduleclose", true);
65
        out.put("moduleonopen", true);
66
        out.put("moduleonclose", true);
67
        out.put("guiscroll", true);
68
        out.put("guislidermove", true);
69
        return out;
70
    }
71
72
    @Override
73
    public void onDisable() {
74
        Minecraft mc = Minecraft.getInstance();
75
        boolean clickGuiScreen = mc != null && (ClientScreen.current() instanceof ClickGuiScreen
76
                || ClientScreen.current() instanceof ClickGuiPickerScreen
77
                || ClientScreen.current() instanceof ClickGuiEditorScreen);
78
79
        if (!suppressScreenClose && clickGuiScreen) {
80
            GuiSound.CLOSE.feedback();
81
            ClickGuiRenderer.beginCloseAnimation();
82
            return;
83
        }
84
85
        ClickGuiRenderer.finishCloseImmediately();
86
        if (mc != null && clickGuiScreen && !suppressScreenClose) {
87
            ClientScreen.show(mc, null);
88
        }
89
    }
90
91
    @Override
92
    public void onEnable() {
93
        Minecraft mc = Minecraft.getInstance();
94
        if (mc == null || (ClientScreen.current() != null && !ClickGuiRenderer.isClosingForExit())) {
95
            setEnabled(false);
96
            return;
97
        }
98
        ClickGuiRenderer.beginOpenAnimation();
99
        ClickGuiRenderer.openClickGuiScreen();
100
    }
101
102
    public boolean isGuiSoundEnabled(String key) {
103
        return guiSoundToggles.get(key);
104
    }
105
106
    public float getGuiSoundVolume() {
107
        return guiSoundVolume.get().floatValue();
108
    }
109
}
110
KiwiClientCLIENTsrc/main/java/com/tangykiwi/kiwiclient/module/client/ClickGUI.javaJava · 32 lines · 950 B

Renders the ClickGUI

SettingsLength
ClickGUI.javaJava · Minecraft 26.2 · 32 lines · 950 B · complete file, verbatimOriginal ↗
1
package com.tangykiwi.kiwiclient.module.client;
2
3
import com.tangykiwi.kiwiclient.gui.clickgui.ClickGUIScreen;
4
import com.tangykiwi.kiwiclient.module.Category;
5
import com.tangykiwi.kiwiclient.module.Module;
6
import com.tangykiwi.kiwiclient.module.setting.SliderSetting;
7
import org.lwjgl.glfw.GLFW;
8
9
import static com.tangykiwi.kiwiclient.KiwiClient.mc;
10
11
public class ClickGUI extends Module {
12
    public SliderSetting length = new SliderSetting("Length", "Maximum window module length", 1, 24, 24, 0);
13
14
    public ClickGUI() {
15
        super("ClickGUI", "Renders the ClickGUI", GLFW.GLFW_KEY_SEMICOLON, Category.CLIENT);
16
        // this.addSetting(length);
17
    }
18
19
    @Override
20
    public void onEnable() {
21
        mc.setScreenAndShow(ClickGUIScreen.INSTANCE);
22
        setEnabled(false);
23
    }
24
25
    @Override
26
    public void onDisable() {
27
        if (mc.gui.screen() instanceof ClickGUIScreen) {
28
            mc.setScreenAndShow(null);
29
        }
30
    }
31
}
32
LiquidBounce (Kotlin)RENDERsrc/main/kotlin/net/ccbluex/liquidbounce/features/module/modules/render/ModuleClickGui.ktKotlin · 193 lines · 6.7 KB

Shows you an easy to use menu to toggle and configure modules.

SettingsScaleSearchBarAutoFocusGridSizeCache
ModuleClickGui.ktKotlin · Minecraft 26.2 · 193 lines · 6.7 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 com.mojang.blaze3d.platform.InputConstants
22
import net.ccbluex.liquidbounce.LiquidBounce
23
import net.ccbluex.liquidbounce.config.types.group.ToggleableValueGroup
24
import net.ccbluex.liquidbounce.event.EventManager
25
import net.ccbluex.liquidbounce.event.events.BrowserReadyEvent
26
import net.ccbluex.liquidbounce.event.events.ClickGuiScaleChangeEvent
27
import net.ccbluex.liquidbounce.event.events.ClickGuiValueChangeEvent
28
import net.ccbluex.liquidbounce.event.events.DisconnectEvent
29
import net.ccbluex.liquidbounce.event.events.GameTickEvent
30
import net.ccbluex.liquidbounce.event.events.WorldChangeEvent
31
import net.ccbluex.liquidbounce.event.handler
32
import net.ccbluex.liquidbounce.event.sequenceHandler
33
import net.ccbluex.liquidbounce.event.waitSeconds
34
import net.ccbluex.liquidbounce.features.addon.AddonApi
35
import net.ccbluex.liquidbounce.features.module.ClientModule
36
import net.ccbluex.liquidbounce.features.module.ModuleCategories
37
import net.ccbluex.liquidbounce.integration.interop.protocol.rest.v1.game.isTyping
38
import net.ccbluex.liquidbounce.integration.screen.CustomScreenType
39
import net.ccbluex.liquidbounce.integration.screen.ScreenManager
40
import net.ccbluex.liquidbounce.integration.screen.impl.CustomSharedMinecraftScreen
41
import net.ccbluex.liquidbounce.integration.screen.impl.CustomStandaloneMinecraftScreen
42
import net.ccbluex.liquidbounce.utils.client.inGame
43
import net.ccbluex.liquidbounce.utils.kotlin.EventPriorityConvention.OBJECTION_AGAINST_EVERYTHING
44
import net.ccbluex.liquidbounce.utils.kotlin.EventPriorityConvention.READ_FINAL_STATE
45
46
/**
47
 * ClickGUI module
48
 *
49
 * Shows you an easy-to-use menu to toggle and configure modules.
50
 */
51
52
@AddonApi
53
object ModuleClickGui :
54
    ClientModule("ClickGUI", ModuleCategories.RENDER, bind = InputConstants.KEY_RSHIFT, disableActivation = true) {
55
56
    override val running get() = true
57
58
    @Suppress("UnusedPrivateProperty")
59
    private val scale by float("Scale", 1f, 0.5f..2f).onChanged {
60
        EventManager.callEvent(ClickGuiScaleChangeEvent(it))
61
        EventManager.callEvent(ClickGuiValueChangeEvent(this))
62
    }
63
64
    @Suppress("UnusedPrivateProperty", "unused")
65
    private val searchBarAutoFocus by boolean("SearchBarAutoFocus", true).onChanged {
66
        EventManager.callEvent(ClickGuiValueChangeEvent(this))
67
    }
68
69
    val isInSearchBar: Boolean
70
        get() {
71
            if (!isTyping) {
72
                return false
73
            }
74
75
            val screen = mc.gui.screen() ?: return false
76
            return screen is CustomSharedMinecraftScreen && screen.screenType == CustomScreenType.CLICK_GUI ||
77
                screen is CustomStandaloneMinecraftScreen && screen.screenType == CustomScreenType.CLICK_GUI
78
        }
79
80
    object Snapping : ToggleableValueGroup(this, "Snapping", true) {
81
82
        @Suppress("UnusedPrivateProperty", "unused")
83
        private val gridSize by int("GridSize", 10, 1..100, "px").onChanged {
84
            EventManager.callEvent(ClickGuiValueChangeEvent(ModuleClickGui))
85
        }
86
87
        init {
88
            inner.find { it.name == "Enabled" }?.onChanged {
89
                EventManager.callEvent(ClickGuiValueChangeEvent(ModuleClickGui))
90
            }
91
        }
92
    }
93
94
    init {
95
        tree(Snapping)
96
    }
97
98
    @Suppress("UnusedPrivateProperty")
99
    private val useStandaloneScreen by boolean("Cache", true).onChanged {
100
        mc.execute(::onEnabled)
101
    }
102
103
    // Standalone screen instance for caching
104
    private var standaloneScreen: CustomStandaloneMinecraftScreen? = null
105
106
    @Suppress("unused")
107
    private val browserReadyHandler = handler<BrowserReadyEvent>(priority = READ_FINAL_STATE) {
108
        tree(ScreenManager.browserSettings)
109
    }
110
111
    override fun onEnabled() {
112
        if (!LiquidBounce.isInitialized || !inGame) {
113
            return
114
        }
115
116
        updateStandaloneScreen()
117
        mc.execute {
118
            mc.gui.setScreen(standaloneScreen ?: CustomSharedMinecraftScreen(CustomScreenType.CLICK_GUI))
119
        }
120
        super.onEnabled()
121
    }
122
123
    @Suppress("unused")
124
    private val worldChangeHandler = sequenceHandler<WorldChangeEvent>(
125
        priority = OBJECTION_AGAINST_EVERYTHING
126
    ) { event ->
127
        if (event.world == null || !useStandaloneScreen) {
128
            return@sequenceHandler
129
        }
130
131
        waitSeconds(1)
132
        if (updateStandaloneScreen()) {
133
            standaloneScreen?.sync()
134
        }
135
    }
136
137
    @Suppress("unused")
138
    private val disconnectHandler = handler<DisconnectEvent> {
139
        standaloneScreen?.close()
140
        standaloneScreen = null
141
    }
142
143
    @Suppress("unused")
144
    private val tickHandler = handler<GameTickEvent> {
145
        // For some reason, we actually need this.
146
        standaloneScreen?.browser?.visible = mc.gui.screen() == standaloneScreen
147
    }
148
149
    fun updateStandaloneScreen(): Boolean {
150
        // Standalone Screen Cache
151
        if (useStandaloneScreen) {
152
            if (standaloneScreen == null) {
153
                standaloneScreen = CustomStandaloneMinecraftScreen(CustomScreenType.CLICK_GUI)
154
            } else {
155
                // Used in [worldChangeHandler] to determine if we need to sync.
156
                return true
157
            }
158
        } else if (standaloneScreen != null) {
159
            standaloneScreen?.close()
160
            standaloneScreen = null
161
        }
162
163
        return false
164
    }
165
166
    fun sync() {
167
        if (!LiquidBounce.isInitialized) {
168
            return
169
        }
170
171
        standaloneScreen?.sync()
172
    }
173
174
    fun invalidate() {
175
        val standaloneScreen = standaloneScreen ?: return
176
        val wasOpen = mc.gui.screen() == standaloneScreen
177
178
        // Close and invalidate old cache
179
        if (wasOpen) {
180
            mc.gui.setScreen(null)
181
        }
182
        standaloneScreen.close()
183
        this.standaloneScreen = null
184
185
        // Only bother updating now if it was open before.
186
        if (wasOpen) {
187
            updateStandaloneScreen()
188
            mc.gui.setScreen(this.standaloneScreen ?: CustomSharedMinecraftScreen(CustomScreenType.CLICK_GUI))
189
        }
190
    }
191
192
}
193