CBSK
Cassetu's Better Sticky Keys (CBSK) 是一款适用于 Minecraft 1.21.11 的客户端 Fabric 模组,允许你将按键锁定在按下状态,从而解放双手进行挖掘、疾跑或交互——即使 Minecraft 窗口最小化或未获得焦点时也能生效。
粘滞键(Sticky Keys)
按住任意移动或操作键组合的同时按下 K(可重新绑定),这些按键会被锁定在按下状态,直到你再次按下 K、打开界面或按下 Escape 才会解除。防误触冷却时间(默认 800ms,可配置)可防止在停用后立即重新激活。该功能在游戏窗口失去焦点时同样有效——它通过 Mixin 挂钩到引擎的输入系统,而非直接轮询 GLFW,因此游戏会保持运行,仿佛你一直按着这些键。
自动工具切换(Auto Tool Switch)
当粘滞攻击处于激活状态且你正在挖掘时,模组会自动从快捷栏中选择最适合当前注视方块的工具。两种模式:MINIMUM 选择能实际挖掘该方块的最低阶工具(节省钻石/下界合金),BEST_ENCHANT 选择效率、抢夺、精准采集和耐久度附魔等级综合评分最高的工具。如果某件工具的耐久度低于阈值(默认剩余 5 次使用),模组会在继续之前尝试从主背包中抽取一件匹配的工具。如果你的准星移动到没有有效工具可以挖掘的方块上,挖掘将暂停(攻击输入被抑制,每 2 秒发出一次警告声),并在你看向可挖掘方块时自动恢复——此过程绝不会完全停用粘滞键。
粘滞疾跑(Sticky Sprint)
一个独立的切换键(默认 V)可将疾跑状态单独锁定。每个游戏刻都会强制对玩家执行 setSprinting(true),即使在受到伤害硬直、打开物品栏或其他中断情况下也能保持疾跑状态。可与粘滞键同时使用,也可独立使用。
自动进食(Auto Eat)
当饥饿值降至可配置的阈值以下(默认 16/20)时,模组会自动从快捷栏或主背包中选择并食用最佳食物。“最佳”定义为:若启用了偏好饱和度选项,则选择饱和度最高的食物;否则选择营养值最高的食物。进食后,模组会恢复之前选中的物品槽位。该功能在后台被动运行,无需粘滞键处于激活状态。
HUD 覆盖层
一个小文本覆盖层(位置可按屏幕尺寸比例配置),显示以下内容:粘滞键状态及已锁定的按键、疾跑锁定状态、当前工具名称及剩余耐久度(低于阈值时显示为红色)、饥饿值(低于阈值时显示为红色)、“挖掘:已暂停”提示(当自动工具无法找到有效工具时),以及自动进食期间的“进食中…”指示器。尊重原版 F1 隐藏 HUD 的切换设置。
配置界面
通过 [ 键打开(可重新绑定)。包含所有功能的切换按钮、工具模式的循环选择按钮、耐久度阈值(1–20)、饥饿值阈值(2–20)和冷却时间(200ms–2000ms,步进调整)。所有设置均通过 Gson 持久化至 config/cbsk.json,并在运行时读写,无需重启游戏。
按键绑定(均可在控制设置中重新绑定):切换粘滞键(K)、切换疾跑锁定(V)、打开配置([)。
CBSK
Cassetu's Better Sticky Keys (CBSK) is a client-side Fabric mod for Minecraft 1.21.11 that lets you lock inputs in their pressed state so you can mine, sprint, or interact hands-free — including when the Minecraft window is minimized or unfocused.
Sticky Keys
Press K (rebindable) while holding any combination of movement or action keys. Those keys get locked in their pressed state until you press K again, open a screen, or hit Escape. A cooldown (default 800ms, configurable) prevents accidental re-activation immediately after deactivating. The feature works even when the game window loses focus — it uses Mixin hooks into the engine's input system rather than polling GLFW directly, so the game keeps running as if you were holding the keys.
Auto Tool Switch
When sticky attack is active and you're mining, the mod automatically selects the best tool in your hotbar for the block you're looking at. Two modes: MINIMUM picks the lowest tier that can actually mine the block (conserves diamond/netherite), BEST_ENCHANT picks whichever tool scores highest on Efficiency, Fortune, Silk Touch, and Unbreaking levels. If a tool hits the durability threshold (default 5 remaining uses), the mod tries to pull a matching tool from your main inventory before moving on. If your crosshair moves to a block you have no valid tool for, mining is paused (attack input suppressed, periodic warning sound every 2 seconds) and resumes automatically once you look at something you can mine — it never fully deactivates sticky keys over this.
Sticky Sprint
A separate toggle key (default V) locks sprinting on independently of sticky keys. Every tick it forces setSprinting(true) on the player, keeping you sprinting even through damage flinches, inventory moments, or other interruptions. Can be used with or without sticky keys active.
Auto Eat
When your hunger drops below a configurable threshold (default 16/20), the mod selects and uses the best food in your hotbar or main inventory automatically. "Best" means highest saturation if the prefer-saturation option is on, otherwise highest nutrition. After eating it restores your previously selected slot. Works passively in the background and does not require sticky keys to be active.
HUD Overlay
A small text overlay (position configurable as a fraction of screen size) shows: sticky keys status and which keys are locked, sprint lock state, current tool name and remaining durability (red if below threshold), hunger level (red if below threshold), a "Mining: PAUSED" notice when auto tool can't find a valid tool, and an "Eating…" indicator during auto eat. Respects the vanilla F1 HUD-hidden toggle.
Config Screen
Opened with [ (rebindable). Toggle buttons for every feature, cycle buttons for tool mode, durability threshold (1–20), hunger threshold (2–20), and cooldown (200ms–2000ms in steps). All settings persist to config/cbsk.json via Gson and are read/written at runtime with no restart required.
Key bindings (all rebindable in Controls): Toggle Sticky Keys (K), Toggle Sprint Lock (V), Open Config ([).
评论 0
登录后参与评分
还没有评论,来抢沙发吧