
Smart Key Prompts
The Smart Key Prompts mod for Minecraft offers players smart control prompts and convenient key remapping, significantly improving gameplay and simplifying keybind management.
Main Features
This mod dynamically displays relevant control prompts depending on the current game context. Developers can use the provided APIs to manage prompt visibility:
// Show a registered key binding by identifier
public static void show(String id, String desc);
// Display a custom prompt with key and description
public static void custom(String id, String key, String desc);
// Create an alias for an existing key binding with a different label
public static void alias(String id, String key, String desc);
Call these methods during client tick with conditional logic to display prompts. Support through datapacks is also available, though with some conditional limitations.
Each id
represents a key group identifier. For example, JEI integration uses jei_skp
and is disabled by default. You can disable or enable key groups at any time through configuration using their identifiers.
In-Game Controls
When prompts are visible:
- Press Control (default: K) + Left Click to open the keybinding settings screen
- Press Control + Right Click to toggle HUD visibility and position
- Scroll mouse wheel while holding Control to change HUD scale
Note: Quick keybinding configuration only works for
show
andalias
. It does not work forcustom
prompts.
Holding the Control key locks the prompts, eliminating the need for precise timing of interactions.
Usage Examples
Java Example:
@SubscribeEvent
public static void tick(TickEvent.ClientTickEvent event) {
if (!ModList.get().isLoaded("immersive_aircraft")) return;
Player player = Minecraft.getInstance().player;
if (player == null || Minecraft.getInstance().screen != null) return;
String vehicle = Utils.getVehicleType(player);
if (vehicle != null && vehicle.startsWith("immersive_aircraft:")) {
SmartKeyPrompts.custom(modid, Utils.getKeyByDesc("key.inventory"), "immersive_aircraft.slot.upgrade");
SmartKeyPrompts.show(modid, "key.immersive_aircraft.dismount");
String keyUse = Utils.getKeyByDesc("key.immersive_aircraft.fallback_use");
SmartKeyPrompts.custom(modid,
Objects.equals(keyUse, "key.keyboard.unknown") ? "key.mouse.right" : keyUse,
"item.immersive_aircraft.item.weapon");
if (vehicle.equals("immersive_aircraft:biplane")) {
SmartKeyPrompts.custom(modid, Utils.getKeyByDesc("key.jump"), "item.immersive_aircraft.engine");
}
}
}
KubeJS Example:
let SmartKeyPrompts = Java.loadClass("com.mafuyu404.smartkeyprompts.SmartKeyPrompts");
let Utils = Java.loadClass("com.mafuyu404.smartkeyprompts.init.Utils");
ClientEvents.tick(event => {
let player = event.player;
if (["key.left", "key.right", "key.forward", "key.back"]
.map(desc => Utils.isKeyPressedOfDesc(desc)).includes(true)) {
SmartKeyPrompts.show("parcool", "key.parcool.Dodge");
}
if (!player.onGround() && !player.isInWater()) {
SmartKeyPrompts.show("parcool", "key.parcool.Breakfall");
SmartKeyPrompts.show("parcool", "key.parcool.ClingToCliff");
}
if (player.isSprinting()) {
SmartKeyPrompts.show("parcool", "key.parcool.FastRun");
}
if (Utils.isKeyPressedOfDesc("key.parcool.FastRun")) {
SmartKeyPrompts.show("parcool", Utils.getKeyByDesc("key.parcool.Dodge"));
SmartKeyPrompts.custom("parcool", Utils.getKeyByDesc("key.sneak"), "parcool.action.CatLeap");
}
});
Datapack Example:
{
"modid": "tacz_skp",
"vars": {
"modLoaded": "isModLoaded('tacz')",
"hasTaczGun": "mainHandItem() == 'tacz:modern_kinetic_gun'",
"isNotInVehicle": "!isInVehicle()"
},
"entries": [
{
"when": {
"modLoaded": "true",
"hasTaczGun": "true",
"isNotInVehicle": "true"
},
"then": [
"show('tacz_skp', 'key.tacz.shoot.desc')",
"show('tacz_skp', 'key.tacz.zoom.desc')",
"show('tacz_skp', 'key.tacz.reload.desc')"
]
}
]
}
Planned Features
- More prompt display positions (e.g., follow cursor)
- Support for double-tap and long-press keys
- HUD aesthetic improvements
- Possible cross-version support