Command Macro Key - Command Macros for Minecraft
Tired of constantly typing the same commands in Minecraft? This mod allows you to assign hotkeys for quick execution of any commands, saving your time and effort.
Macro Types
The mod supports three different types of macros for various usage scenarios:
- Single - command execution once when pressing a key
- Delayed - command execution after a specified time delay
- Repeating - multiple command executions with a set interval
Key Features
For configuring hotkeys, use numeric key codes. A complete list of available codes can be found in the GLFW documentation.
The /macro reload command allows instant reloading of macro configuration without restarting the game.
If the command field lacks the "/" symbol, the text will be sent as a regular chat message.
To execute multiple commands in sequence, use the \n separator. For example: "Hello World\nHello Minecraft"
Placeholder Parameters
The mod provides a set of useful placeholder parameters for dynamic command formation:
player_name
player_pos_x
player_pos_y
player_pos_z
player_pos
player_health
player_food
player_exp
player_level
player_dimension
player_biome
player_facing
player_xRot
player_yRot
player_uuid
For example, the command "/gamemode creative %player_name%" will automatically substitute the current player's name.
Configuration Examples
[
{
"macro":"command_macro_key:single",
"command": "/gamemode creative",
"primaryKey": 334,
"modifierKey": 0
},
{
"macro":"command_macro_key:delayed",
"command": "/gamemode creative",
"primaryKey": 334,
"modifierKey": 0,
"delay": 60
},
{
"macro":"command_macro_key:repeating",
"command": "/gamemode creative",
"primaryKey": 334,
"modifierKey": 0,
"repeat": 5,
"interval": 20
},
{
"macro":"command_macro_key:single",
"command": "/gamemode creative",
"primaryKey": 334,
"modifierKey": 0,
//optional field
//Only works in macros-server.json5 configuration, if this field is present, permissions are ignored
"hasOp": true,
//optional field
//Only valid for a specific save
"location": ".\saves\~"
}
]