⌨️ 按键绑定
将按键绑定到服务器端命令。按下按键,服务器执行一条命令。
客户端模组 (Fabric) • 服务端插件 (Paper)
| 环境 | 加载器 | MC 版本 | 状态 |
|---|---|---|---|
| 客户端 | Fabric | 1.21.x, 26.x | 已发布 |
| 服务端 | Paper | 1.18.2+ | 已发布 |
| 客户端 | NeoForge | 1.21.x, 26.x | 已发布 |
| 客户端 | Forge | 1.21.x, 26.x | 已发布 |
注意:必须同时安装服务端插件和对应的客户端模组,按键绑定才能正常工作。在没有安装该插件的服务器上,不会注册或提供任何按键绑定。
✨ 特性
- ? 服务端驱动:动作完全由服务端定义,并在玩家加入时同步到客户端。
- ? 按服务器存储:按键分配保存在
.minecraft/config/keybind-servers/中,以服务器 IP 为区分,重新加入时不会被覆盖。 - ?️ 动态注册:新的服务器动作无需重启游戏即可出现在你的 设置 → 控制 菜单中。
- ? 游戏内管理器:在 Paper 1.21.7+ 上,
/kbind manage会打开一个 Minecraft 对话框,允许你添加、编辑或删除按键绑定,而无需触碰config.yml。点击 Press a key…(按下某键…),然后按下你想绑定的按键(需要客户端模组)。 - ?️ 备用箱子 GUI:对于没有 Paper Dialog API 的服务器,提供交互式的 54 格箱子 GUI 作为备用方案。
- ? 自动更新通知:检查 GitHub 发行版,当有新版本可用时,在玩家加入时自动通知管理员。
- ? bStats 指标:完全匿名的服务器遥测数据,有助于跟踪插件的使用情况和普及率。
- ?️ 自定义显示名称:服务器所有者可以设置友好的名称(例如
"Teleport to Spawn"而不是spawn)。 - ⏱️ 双重冷却时间:全局冷却时间(任意动作之间)和每个动作单独的冷却时间可防止滥用。
- ? 权限支持:除了基础的
keybind.use权限外,每个动作还支持可选的额外权限节点。 - ? 插件消息通道:使用
keybind:main/keybind:sync插件消息通道。如果数据包通道不可用,则回退到/kbind <action>。 - ? 过期动作清理:来自之前会话的过时动作会自动从控制菜单和保存的配置中移除。
- ? 多加载器客户端:提供适用于 Minecraft 1.21.x 和 26.x 的 Fabric、Forge 和 NeoForge 构建版本。
? 工作原理
- 同步:玩家加入后 1 秒,插件通过
keybind:sync通道发送所有配置好的动作(名称、显示名称、默认按键)。 - 注册:模组将每个动作注册为 Minecraft 原生按键绑定,归类于 设置 → 控制 中的 Keybind 类别下。
- 触发:当按下按键且没有打开任何屏幕时,模组通过
keybind:main通道发送动作名称。 - 执行:插件验证动作名称(仅限字母数字和下划线),检查权限和冷却时间,然后运行命令。
?️ 安装
服务端
- 将
Keybind-Plugin-1.0.4.jar放入你的plugins/文件夹。 - 重启服务器 ——
plugins/Keybind/config.yml会自动生成。 - 编辑
config.yml定义你的动作,然后运行/kbind reload。
客户端
- 将与你的 Minecraft 版本和加载器匹配的客户端 jar 文件安装到
.minecraft/mods/中。 - 安装所选平台所需的加载器和 API。Minecraft 1.21.x 请使用 Java 21,Minecraft 26.x 请使用 Java 25。
- 不要同时安装多个 Keybind 客户端 jar 文件。启动游戏并连接到运行了 Keybind 插件的服务器。
⚙️ 配置
plugins/Keybind/config.yml
# 更新检查器(检查 GitHub 发行版并在玩家加入时通知管理员)
update-checker: true
# 任意按键绑定动作之间的全局冷却时间(毫秒)
global-cooldown: 500
actions:
spawn:
command: "spawn" # 要执行的命令(不带 /)
display-name: "Spawn" # 在控制菜单中显示的标签
default-key: "LEFT_BRACKET" # 首次连接玩家的建议按键
permission: "" # 可选的额外权限节点(留空表示无)
cooldown: 1000 # 单个动作的冷却时间(毫秒);默认为 global-cooldown
console: false # true = 以控制台身份运行,并将 {player} 替换为玩家名称
home:
command: "home"
display-name: "Home"
default-key: "RIGHT_BRACKET"
permission: ""
cooldown: 1000
console: false
# 启用匿名指标报告(bStats)
metrics: true
说明:
- 动作名称必须仅包含字母数字字符和下划线(例如
my_action)。 console: true将以控制台发送者的身份运行命令。使用{player}作为玩家名称的占位符(例如command: "tp {player} spawn")。default-key仅在玩家首次连接时应用。后续加入时将使用他们保存的绑定。
⌨️ 支持的按键
键盘
| 类别 | 值 |
|---|---|
| 字母键 | A–Z |
| 数字键 | 0–9 |
| 功能键 | F1–F25 |
| 方向键 | UP, DOWN, LEFT, RIGHT |
| 导航键 | PAGE_UP, PAGE_DOWN, HOME, END, INSERT, DELETE |
| 特殊键 | SPACE, ENTER, TAB, BACKSPACE, ESCAPE, PAUSE |
| 锁定键 | CAPS_LOCK, SCROLL_LOCK, NUM_LOCK |
| 其他键 | PRINT_SCREEN, MENU |
| 修饰键 | LEFT_SHIFT, LEFT_CONTROL(或 LEFT_CTRL), LEFT_ALT, LEFT_SUPER, RIGHT_SHIFT, RIGHT_CONTROL(或 RIGHT_CTRL), RIGHT_ALT, RIGHT_SUPER |
| 小键盘 | KP_0–KP_9, KP_ADD, KP_SUBTRACT, KP_MULTIPLY, KP_DIVIDE, KP_DECIMAL, KP_ENTER, KP_EQUAL |
| 符号键 | LEFT_BRACKET, RIGHT_BRACKET, BACKSLASH, SEMICOLON, APOSTROPHE, COMMA, PERIOD, SLASH, GRAVE_ACCENT, MINUS, EQUAL — 或直接使用字符:[, ], \, ;, ', ,, ., /, `, -, = |
| 世界键 | WORLD_1, WORLD_2(某些键盘上的区域特定按键) |
鼠标
| 值 | 别名 | 按钮 |
|---|---|---|
MOUSE_LEFT |
MOUSE_1 |
左键点击 |
MOUSE_RIGHT |
MOUSE_2 |
右键点击 |
MOUSE_MIDDLE |
MOUSE_3 |
中键点击 |
MOUSE_4–MOUSE_8 |
— | 侧边/额外按钮 |
? 指令与权限
| 指令 | 描述 | 权限 |
|---|---|---|
/kbind <action> |
手动触发一个动作 | keybind.use |
/kbind list |
列出所有已配置的动作名称 | (任意) |
/kbind manage |
打开 Minecraft 对话框管理器(Paper 1.21.7+) | keybind.admin |
/kbind add <name> <command...> |
创建快捷键绑定 | keybind.admin |
/kbind set <name> <field> <value> |
编辑 command、display、key、permission、cooldown 或 console |
keybind.admin |
/kbind remove <name> |
删除快捷键绑定 | keybind.admin |
/kbind reload |
重新加载配置文件并同步所有在线玩家 | keybind.admin |
| 权限 | 描述 | 默认值 |
|---|---|---|
keybind.use |
触发任何动作所需的权限 | true(所有人) |
keybind.admin |
访问 /kbind manage、添加/设置/删除以及重载的权限 |
op |
keybind.bypass.cooldown |
忽略所有冷却时间 | op |
⌨️ Keybind
Bind keys to server-side commands. Press a key, the server runs a command.
Client Mod (Fabric) • Server Plugin (Paper)
| Environment | Loader | MC Version | Status |
|---|---|---|---|
| Client | Fabric | 1.21.x, 26.x | Released |
| Server | Paper | 1.18.2+ | Released |
| Client | NeoForge | 1.21.x, 26.x | Released |
| Client | Forge | 1.21.x, 26.x | Released |
Note: Both the Server Plugin and the matching Client Mod must be installed for keybinds to function. On servers without the plugin, no keybinds will be registered or available.
✨ Features
- ? Server-Driven: Actions are defined entirely on the server and synced to the client on join.
- ? Per-Server Storage: Key assignments are saved per server IP in
.minecraft/config/keybind-servers/and never overwritten on rejoin. - ?️ Dynamic Registration: New server actions appear in your Settings → Controls menu without restarting the game.
- ? In-game Manager: On Paper 1.21.7+,
/kbind manageopens a Minecraft dialog to add, edit, or delete keybinds without touchingconfig.yml. Click Press a key…, then press the key (client mod required). - ?️ Fallback Chest GUI: Interactive 54-slot Chest GUI fallback for servers without Paper Dialog API.
- ? Automatic Update Notifications: Checks GitHub releases and automatically alerts administrators on join when updates are available.
- ? bStats Metrics: Fully anonymous server telemetry to help track plugin usage and adoption.
- ?️ Custom Display Names: Server owners set friendly names (e.g.,
"Teleport to Spawn"instead ofspawn). - ⏱️ Dual Cooldowns: Both a global cooldown (between any actions) and per-action cooldowns prevent spam.
- ? Permission Support: Each action supports an optional extra permission node on top of
keybind.use. - ? Plugin Messaging: Uses
keybind:main/keybind:syncplugin message channels. Falls back to/kbind <action>if the packet channel is unavailable. - ? Stale Action Cleanup: Obsolete actions from previous sessions are automatically removed from the Controls menu and saved config.
- ? Multi-loader Client: Fabric, Forge, and NeoForge builds available for Minecraft 1.21.x and 26.x.
? How It Works
- Sync: 1 second after a player joins, the plugin sends all configured actions (name, display name, default key) over the
keybind:syncchannel. - Registration: The mod registers each action as a native Minecraft keybind under the Keybind category in Settings → Controls.
- Trigger: When a key is pressed (and no screen is open), the mod sends the action name over the
keybind:mainchannel. - Execution: The plugin validates the action name (alphanumeric + underscores only), checks permissions and cooldowns, then runs the command.
?️ Installation
Server Side
- Place
Keybind-Plugin-1.0.4.jarinto yourplugins/folder. - Restart the server —
plugins/Keybind/config.ymlis generated automatically. - Edit
config.ymlto define your actions, then run/kbind reload.
Client Side
- Install the client jar matching your Minecraft version and loader into
.minecraft/mods/ - Install the required loader and API for the selected platform. Use Java 21 for Minecraft 1.21.x, and Java 25 for Minecraft 26.x.
- Do not install multiple Keybind client jars at the same time. Launch the game and connect to a server running the Keybind plugin.
⚙️ Configuration
plugins/Keybind/config.yml
# Update Checker (checks GitHub releases and notifies admins on join)
update-checker: true
# Global cooldown between any keybind actions (milliseconds)
global-cooldown: 500
actions:
spawn:
command: "spawn" # Command to run (without /)
display-name: "Spawn" # Label shown in Controls menu
default-key: "LEFT_BRACKET" # Suggested key for first-time players
permission: "" # Optional extra permission node (leave empty for none)
cooldown: 1000 # Per-action cooldown (ms); defaults to global-cooldown
console: false # true = run as console with {player} replaced by player name
home:
command: "home"
display-name: "Home"
default-key: "RIGHT_BRACKET"
permission: ""
cooldown: 1000
console: false
# Enable anonymous metrics reporting (bStats)
metrics: true
Notes:
- Action names must be alphanumeric + underscores only (e.g.
my_action). console: trueruns the command as the console sender. Use{player}as a placeholder for the player's name (e.g.command: "tp {player} spawn").default-keyis only applied the first time a player connects. Their saved binding is used on subsequent joins.
⌨️ Supported Keys
Keyboard
| Category | Values |
|---|---|
| Letters | A–Z |
| Numbers | 0–9 |
| Function | F1–F25 |
| Arrows | UP, DOWN, LEFT, RIGHT |
| Navigation | PAGE_UP, PAGE_DOWN, HOME, END, INSERT, DELETE |
| Special | SPACE, ENTER, TAB, BACKSPACE, ESCAPE, PAUSE |
| Lock keys | CAPS_LOCK, SCROLL_LOCK, NUM_LOCK |
| Other | PRINT_SCREEN, MENU |
| Modifiers | LEFT_SHIFT, LEFT_CONTROL (or LEFT_CTRL), LEFT_ALT, LEFT_SUPER, RIGHT_SHIFT, RIGHT_CONTROL (or RIGHT_CTRL), RIGHT_ALT, RIGHT_SUPER |
| Numpad | KP_0–KP_9, KP_ADD, KP_SUBTRACT, KP_MULTIPLY, KP_DIVIDE, KP_DECIMAL, KP_ENTER, KP_EQUAL |
| Symbols | LEFT_BRACKET, RIGHT_BRACKET, BACKSLASH, SEMICOLON, APOSTROPHE, COMMA, PERIOD, SLASH, GRAVE_ACCENT, MINUS, EQUAL — or the character directly: [, ], \, ;, ', ,, ., /, `, -, = |
| World keys | WORLD_1, WORLD_2 (locale-specific keys on some keyboards) |
Mouse
| Value | Aliases | Button |
|---|---|---|
MOUSE_LEFT |
MOUSE_1 |
Left click |
MOUSE_RIGHT |
MOUSE_2 |
Right click |
MOUSE_MIDDLE |
MOUSE_3 |
Middle click |
MOUSE_4–MOUSE_8 |
— | Side/extra buttons |
? Commands & Permissions
| Command | Description | Permission |
|---|---|---|
/kbind <action> |
Manually trigger an action | keybind.use |
/kbind list |
List all configured action names | (any) |
/kbind manage |
Open the Minecraft dialog manager (Paper 1.21.7+) | keybind.admin |
/kbind add <name> <command...> |
Create a keybind | keybind.admin |
/kbind set <name> <field> <value> |
Edit command, display, key, permission, cooldown, or console |
keybind.admin |
/kbind remove <name> |
Delete a keybind | keybind.admin |
/kbind reload |
Reload config and re-sync all online players | keybind.admin |
| Permission | Description | Default |
|---|---|---|
keybind.use |
Required to trigger any action | true (everyone) |
keybind.admin |
Access to /kbind manage, add/set/remove, and reload |
op |
keybind.bypass.cooldown |
Ignore all cooldowns | op |
下载 Keybind
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Keybind
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Keybind
下载 Keybind
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Keybind
下载 Keybind
下载 Keybind
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Keybind
下载 Keybind
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 Keybind
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
修复与可靠性
- 控制菜单重复问题:解决了按键绑定在 设置 → 控制 → 按键绑定 中显示两次并在
options.txt中重复的问题。用基于名称的去重和KeybindManager中的就地映射更新替换了冗余的静态注册。 - 自动设置去重:客户端选项映射会在初始化时自动扫描并删除重复条目。
- Forge 事件监听器清理:移除了 Forge 26 中冗余的
RegisterKeyMappingsEvent注册,转而依赖统一的动态注入以避免重复。 - 聊天格式与编码:将聊天同步和按键捕获覆盖层消息中的旧版
\u00a7格式代码替换为原生ChatFormatting文本组件,防止在 Windows 系统上出现A a[Keybind]乱码。 - Forge 26.1 运行时引导:解决了 Forge 26.1 上的启动器问题,该问题会导致选择未打补丁的原版 jar 文件而不是已打补丁的客户端二进制文件。
NeoForge(已发布)
- NeoForge 1.21.11:正式支持针对 NeoForge 21.11.48(Minecraft 1.21.11)。
- NeoForge 26.1 / 26.2:完全支持 Minecraft 26.x,包括自定义分类排序、有效载荷网络通信和客户端刻处理。
- NeoForge 1.21:稳定版本,针对 NeoForge 21.0.167。
插件
- 箱子 GUI 回退:添加了带有分页和点击音效的交互式 54 格箱子 GUI,适用于没有 Paper Dialog API 的服务器。
- 更新检查器:加入服务器时自动检查 GitHub 发行版并通知管理员。
- 指标统计:通过 bStats 进行匿名遥测。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
查看物品与配方
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
添加区块认领和玩家组队功能,并与 Xaero's Minimap 和 World Map 集成
评论 0
登录后参与评分
还没有评论,来抢沙发吧