From ff4657a7f978dce2aecf3d5e349fc5e3290050cf Mon Sep 17 00:00:00 2001 From: Moxvallix Mox Date: Tue, 21 Oct 2025 13:15:44 +1030 Subject: [PATCH] feat(module): implement option to disable middle click action in creative mode, as to not interrupt pick blocking --- .../systems/modules/player/MiddleClickExtra.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/main/java/meteordevelopment/meteorclient/systems/modules/player/MiddleClickExtra.java b/src/main/java/meteordevelopment/meteorclient/systems/modules/player/MiddleClickExtra.java index 1b01859621..0e08757c94 100644 --- a/src/main/java/meteordevelopment/meteorclient/systems/modules/player/MiddleClickExtra.java +++ b/src/main/java/meteordevelopment/meteorclient/systems/modules/player/MiddleClickExtra.java @@ -29,6 +29,7 @@ import net.minecraft.item.Items; import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket; import net.minecraft.util.Hand; +import net.minecraft.world.GameMode; import static org.lwjgl.glfw.GLFW.GLFW_MOUSE_BUTTON_MIDDLE; @@ -66,6 +67,13 @@ public class MiddleClickExtra extends Module { .build() ); + private final Setting disableInCreative = sgGeneral.add(new BoolSetting.Builder() + .name("disable-in-creative") + .description("Middle click action is disabled in Creative mode.") + .defaultValue(true) + .build() + ); + private final Setting notify = sgGeneral.add(new BoolSetting.Builder() .name("notify") .description("Notifies you when you do not have the specified item in your hotbar.") @@ -92,6 +100,8 @@ public void onDeactivate() { private void onMouseClick(MouseClickEvent event) { if (event.action != KeyAction.Press || event.button() != GLFW_MOUSE_BUTTON_MIDDLE || mc.currentScreen != null) return; + if (disabledByCreative()) return; + if (mode.get() == Mode.AddFriend) { if (mc.targetedEntity == null) return; if (!(mc.targetedEntity instanceof PlayerEntity player)) return; @@ -180,6 +190,12 @@ void swapBack(boolean wasCancelled) { } } + private boolean disabledByCreative() { + if (mc.player == null) return false; + + return disableInCreative.get() && mc.player.getGameMode() == GameMode.CREATIVE; + } + public enum Mode { Pearl(Items.ENDER_PEARL, true), XP(Items.EXPERIENCE_BOTTLE, true),