Binders
Binders 是一款轻量级的实用模组与 API,专为希望在整合包或模组中向玩家突出显示重要按键绑定的开发者设计。不再需要困惑或在菜单中翻找以确认特定按键绑定。Binders 让关键按键绑定脱颖而出!
功能
? 屏幕内按键绑定高亮
在屏幕上直接显示按键绑定,支持自定义图标、标签和位置。
? 完全可配置
支持 JSON 配置文件来控制显示哪些按键绑定、何时显示以及如何显示。支持正则表达式匹配以供高级用户使用。
? 上下文感知显示
使按键绑定仅在特定情况下出现(例如:飞行时、手持特定物品时、在下界中等)。
? 自定义样式
通过调整颜色、字体和动画来修改外观,以匹配你的整合包主题。
? 动态更新
自动响应按键重新映射,确保屏幕上的显示始终准确无误。
⌨️ 实用命令
使用 /binders dump 将所有可用的按键绑定 ID 记录到 latest.log 中以便参考。
使用 /binders reload 在游戏不重启的情况下重新加载配置。
配置指南
Binders 定义在 config/binders/binders_definitions.json 文件中。
示例定义
{
"keyBinding": "key.jump",
"label": "Jump",
"iconItem": "minecraft:feather",
"context": "always",
"contextLogic": "OR",
"color": "#FFFFFF",
"scale": 1.0,
"showLabel": true,
"maxPresses": -1,
"resetOnLog": false,
"isRegex": false,
"dynamicIcon": false
}
上下文系统
context 字段决定了 Binder 何时可见。你可以用逗号分隔列出多个上下文。
逻辑:
"contextLogic": "OR"(默认):如果列出的上下文中任意一个为真,Binder 就会显示。
"contextLogic": "AND":仅当列出的上下文中所有条件都为真时,Binder 才会显示。
基础上下文
always: 始终可见。
flying: 飞行时可见(创造模式或生存模式)。
creative: 在创造模式下可见。
survival: 在生存模式或冒险模式下可见。
sneaking: 潜行时可见。
sprinting: 冲刺时可见。
swimming: 游泳时可见。
on_ground: 站在固体地面上时可见。
riding: 骑乘任何实体(马、船等)时可见。
raining: 下雨时可见。
thundering: 雷暴期间可见。
高级上下文
- 手持物品:
holding:<item_id>: 在主手或副手持有该物品。
holding_main:<item_id>: 在主手持有该物品。
holding_off:<item_id>: 在副手持有该物品。
- 穿戴护甲:
wearing_head:<item_id>
wearing_chest:<item_id>
wearing_legs:<item_id>
wearing_feet:<item_id>
- 世界与玩家状态:
dimension:<dimension_id>: 例如 dimension:minecraft:the_nether
biome:<biome_id>: 例如 biome:minecraft:plains
health_below:<value>: 例如 health_below:10(生命值低于 5 颗心时显示)。
hunger_below:<value>: 例如 hunger_below:6(饥饿值低于 3 根鸡腿肉时显示)。
- 注视目标:
looking_at_block:<block_id>: 例如 looking_at_block:minecraft:chest
looking_at_entity:<entity_id>: 例如 looking_at_entity:minecraft:villager
looking_at_tag:<tag_id>: 例如 looking_at_tag:minecraft:logs
通配符与正则表达式
- 你可以使用
*、any 或 *:* 作为物品、方块或实体的通配符。
- 示例:
looking_at_entity:*(注视任何实体时可见)。
- 如果
"isRegex": true,你可以对物品/方块 ID 使用正则表达式。
- 示例:
holding:.*_sword(手持任何剑时可见)。
动态图标
如果 "dynamicIcon": true,Binder 将尝试使用触发上下文的物品作为图标。
- 示例: 如果上下文是
holding:minecraft:diamond_sword,图标将变为钻石剑。
适用场景
- 整合包创作者,希望引导新玩家。
- 冒险地图,其中特定动作具有上下文敏感性。
- 教程或训练场景。
兼容性
- Minecraft Forge (1.20.1)
- 可与大多数 HUD 和 GUI 模组共存。
Binders
Binders is a lightweight utility mod and API designed for modpack and mod developers who want to highlight important keybinds to players. No more confusion or hunting through menus to figure out a specific keybind. Binders makes critical keybinds stand out!
Features
? On-Screen Keybind Highlights
Show keybinds directly on the screen with customizable icons, labels, and locations.
? Fully Configurable
JSON configuration support to control what keybinds are shown, when, and how. Supports regex matching for advanced users.
? Context-Aware Display
Make keybinds appear only during specific situations (e.g., when flying, while holding a specific item, in the Nether, etc.).
? Custom Styling
Tweak the appearance with colors, fonts, and animations to match your modpack’s theme.
? Dynamic Updates
Automatically responds to key remapping, so your on-screen display always stays accurate.
⌨️ Utility Command
Use /binders dump to log all available keybind IDs to latest.log for easy reference.
Use /binders reload to reload your config without restarting the game.
Configuration Guide
Binders are defined in config/binders/binders_definitions.json.
Example Definition
{
"keyBinding": "key.jump",
"label": "Jump",
"iconItem": "minecraft:feather",
"context": "always",
"contextLogic": "OR",
"color": "#FFFFFF",
"scale": 1.0,
"showLabel": true,
"maxPresses": -1,
"resetOnLog": false,
"isRegex": false,
"dynamicIcon": false
}
Context System
The context field determines when a binder is visible. You can list multiple contexts separated by commas.
Logic:
"contextLogic": "OR" (Default): The binder shows if ANY of the listed contexts are true.
"contextLogic": "AND": The binder shows only if ALL of the listed contexts are true.
Basic Contexts
always: Always visible.
flying: Visible when flying (creative or survival).
creative: Visible in Creative mode.
survival: Visible in Survival or Adventure mode.
sneaking: Visible when crouching.
sprinting: Visible when sprinting.
swimming: Visible when swimming.
on_ground: Visible when standing on solid ground.
riding: Visible when riding any entity (horse, boat, etc.).
raining: Visible when it is raining.
thundering: Visible during a thunderstorm.
Advanced Contexts
- Holding Items:
holding:<item_id>: Holding item in either hand.
holding_main:<item_id>: Holding item in main hand.
holding_off:<item_id>: Holding item in off hand.
- Wearing Armor:
wearing_head:<item_id>
wearing_chest:<item_id>
wearing_legs:<item_id>
wearing_feet:<item_id>
- World & Player State:
dimension:<dimension_id>: e.g., dimension:minecraft:the_nether
biome:<biome_id>: e.g., biome:minecraft:plains
health_below:<value>: e.g., health_below:10 (Shows when under 5 hearts).
hunger_below:<value>: e.g., hunger_below:6 (Shows when under 3 food shanks).
- Looking At:
looking_at_block:<block_id>: e.g., looking_at_block:minecraft:chest
looking_at_entity:<entity_id>: e.g., looking_at_entity:minecraft:villager
looking_at_tag:<tag_id>: e.g., looking_at_tag:minecraft:logs
Wildcards & Regex
- You can use
*, any, or *:* as a wildcard for items, blocks, or entities.
- Example:
looking_at_entity:* (Visible when looking at ANY entity).
- If
"isRegex": true, you can use Regular Expressions for item/block IDs.
- Example:
holding:.*_sword (Visible when holding any sword).
Dynamic Icons
If "dynamicIcon": true, the binder will try to use the item that triggered the context as the icon.
- Example: If context is
holding:minecraft:diamond_sword, the icon will become the Diamond Sword.
Perfect For
- Modpack creators who want to guide new players.
- Adventure maps where specific actions are context-sensitive.
- Tutorials or training scenarios.
Compatibility
- Minecraft Forge (1.20.1)
- Works alongside most HUD and GUI mods.
评论 0
登录后参与评分
还没有评论,来抢沙发吧