Dxrk

Mouse Wheel Hit & Place Extra Attack / Destroy keybind Extra Use Item / Place Block keybind Both can be bound to Mouse Wheel Up or Mouse Wheel Down Hold a bypass key (default C) to scroll the hotbar normally again Works in the vanilla Controls → Key Binds screen (just click the keybind and scroll) Registers as real clicks so CPS counters detect them Configurable multiplier in the mod menu: 1x / 2x / 3x (3x = one physical scroll counts as 3 presses) Perfect if you want to mine or place blocks with the scroll wheel while keeping your hotbar free.Client-side only • Fabric • Minecraft 1.21.11

Kodari AI
KodariOct 23 at 2:14 pm 3
ScrollAction
A client-side Fabric mod for Minecraft 1.21.11 that rebinds mouse wheel scrolling to perform actions instead of hotbar switching. Users can bind Mouse Wheel Up or Down to attack/destroy or use/place blocks, with a configurable multiplier (1x/2x/3x) where one physical scroll counts as multiple presses. A bypass key (default C) temporarily restores normal hotbar scrolling. Keybinds appear in the vanilla Controls screen and register as real clicks for CPS detection. Perfect for mining or placing blocks via scroll wheel while keeping the hotbar accessible.
  1. Add the client-only Fabric mod skeleton and metadata.

  2. Implement scroll-wheel binding capture and bypass-to-scroll behavior.

  3. Trigger attack/use through Minecraft’s keybinding input path, with a configurable 1×/2×/3× multiplier.

  4. Add the YACL settings screen and Mod Menu entrypoint.

Created the client-only Fabric 1.21.11 mod. In Controls → Key Binds, bind Extra Attack / Destroy and Extra Use Item / Place Block by selecting each binding and scrolling up or down. Hold C to use the wheel for normal hotbar scrolling.

Added vanilla keybinding-based action presses, a 1× / 2× / 3× multiplier in the Mod Menu configuration screen, and the Fabric project setup.

Dxrk

When you physically scroll the mouse wheel once, the multiplier decides how many times the Attack or Use action is triggered.At 1x (default) one scroll = one press. At 2x one scroll = two presses. At 3x one scroll = three presses in quick succession.This makes CPS counters register multiple clicks from a single physical scroll while still letting you mine or place faster.

Kodari AI
KodariOct 23 at 2:24 pm 1
  • Send each matched wheel event’s 1×/2×/3× count directly to the vanilla Attack or Use keybinding press queue.

  • Remove the intermediate extra-key queue and tick-end forwarding so one scroll produces exactly the configured number of action presses.

Updated wheel handling so each physical scroll queues exactly the configured number of vanilla Attack or Use key presses: 1×, 2×, or 3×. Removed the intermediate forwarding step.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
settings.gradle
Code
12 297
src/client/java/com/kodari/wheelhitplace/WheelHitPlaceClient.java
package com.kodari.wheelhitplace;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents;
import net.fabricmc.fabric.api.client.screen.v1.ScreenMouseEvents;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.option.KeybindsScreen;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.util.Identifier;

import com.kodari.wheelhitplace.mixin.KeybindsScreenAccessor;

public final class WheelHitPlaceClient implements ClientModInitializer {
    private static final int WHEEL_UP_CODE = 100;
    private static final int WHEEL_DOWN_CODE = 101;
    private static final InputUtil.Key WHEEL_UP = InputUtil.Type.MOUSE.createFromCode(WHEEL_UP_CODE);
    private static final InputUtil.Key WHEEL_DOWN = InputUtil.Type.MOUSE.createFromCode(WHEEL_DOWN_CODE);

    private static KeyBinding extraAttackKey;
    private static KeyBinding extraUseKey;
    private static KeyBinding bypassKey;

    @Override
    public void onInitializeClient() {
        WheelHitPlaceConfig.load();

        KeyBinding.Category category = KeyBinding.Category.create(Identifier.of("wheelhitplace", "controls"));
        extraAttackKey = KeyBindingHelper.registerKeyBinding(
                new KeyBinding("key.wheelhitplace.attack", InputUtil.Type.KEYSYM, -1, category));
        extraUseKey = KeyBindingHelper.registerKeyBinding(
                new KeyBinding("key.wheelhitplace.use", InputUtil.Type.KEYSYM, -1, category));
        bypassKey = KeyBindingHelper.registerKeyBinding(
                new KeyBinding("key.wheelhitplace.bypass", InputUtil.Type.KEYSYM, 67, category));

        ScreenEvents.AFTER_INIT.register((client, screen, scaledWidth, scaledHeight) -> {
            if (screen instanceof KeybindsScreen keybindsScreen) {
                ScreenMouseEvents.allowMouseScroll(screen).register((target, mouseX, mouseY, horizontalAmount, verticalAmount) -> {
                    KeyBinding selected = keybindsScreen.selectedKeyBinding;
                    if (verticalAmount == 0.0 || (selected != extraAttackKey && selected != extraUseKey)) {
                        return true;
                    }

                    selected.setBoundKey(wheelKey(verticalAmount));
                    keybindsScreen.selectedKeyBinding = null;
                    ((KeybindsScreenAccessor) keybindsScreen).wheelhitplace$getControlsList().update();
                    return false;
                });
            }
        });

    }

    public static boolean handleMouseScroll(double verticalAmount) {
        MinecraftClient client = MinecraftClient.getInstance();
        if (verticalAmount == 0.0 || client.currentScreen != null || client.player == null || bypassKey == null || bypassKey.isPressed()) {
            return false;
        }

        InputUtil.Key wheelKey = wheelKey(verticalAmount);
        String wheelTranslationKey = wheelKey.getTranslationKey();
        boolean attackBound = extraAttackKey != null && extraAttackKey.getBoundKeyTranslationKey().equals(wheelTranslationKey);
        boolean useBound = extraUseKey != null && extraUseKey.getBoundKeyTranslationKey().equals(wheelTranslationKey);
        if (!attackBound && !useBound) {
            return false;
        }

        for (int press = 0; press < WheelHitPlaceConfig.multiplier(); press++) {
            if (attackBound) {
                KeyBinding.onKeyPressed(InputUtil.fromTranslationKey(client.options.attackKey.getBoundKeyTranslationKey()));
            }
            if (useBound) {
                KeyBinding.onKeyPressed(InputUtil.fromTranslationKey(client.options.useKey.getBoundKeyTranslationKey()));
            }
        }
        return true;
    }

    private static InputUtil.Key wheelKey(double verticalAmount) {
        return verticalAmount > 0.0 ? WHEEL_UP : WHEEL_DOWN;
    }

}