When using the COMMAND_REDIRECT
command mode, it creates a new command alias that redirects to an existing command along with its trailing command arguments.
Create a command alias using COMMAND_REDIRECT
To begin, we must set our command mode to COMMAND_REDIRECT
.
Copy {
"schemaVersion" : 1 ,
"commandMode" : "COMMAND_REDIRECT"
}
Copy schemaVersion = 1
commandMode = "COMMAND_REDIRECT"
Copy schemaVersion : 1
commandMode : COMMAND_REDIRECT
With the command mode set, we can now define our new command.
Copy {
"schemaVersion" : 1 ,
"commandMode" : "COMMAND_REDIRECT" ,
"command" : "s"
}
Copy schemaVersion = 1
commandMode = "COMMAND_REDIRECT"
command = "s"
Copy schemaVersion : 1
commandMode : COMMAND_REDIRECT
command : s
Finally, we must choose the existing command that our new command will redirect to. In this case, I have chosen the /say
command.
Copy {
"schemaVersion" : 1 ,
"commandMode" : "COMMAND_REDIRECT" ,
"command" : "s" ,
"redirectTo" : "say"
}
Copy schemaVersion = 1
commandMode = "COMMAND_REDIRECT"
command = "s"
redirectTo = "say"
Copy schemaVersion : 1
commandMode : COMMAND_REDIRECT
command : s
redirectTo : say
Examples
Time Command
Copy {
"schemaVersion" : 1 ,
"commandMode" : "COMMAND_REDIRECT" ,
"command" : "stime" ,
"redirectTo" : "time set"
}
Copy schemaVersion = 1
commandMode = "COMMAND_REDIRECT"
command = "stime"
redirectTo = "time set"
Copy schemaVersion : 1
commandMode : COMMAND_REDIRECT
command : stime
redirectTo : time set
Scoreboard Command
Copy {
"schemaVersion" : 1 ,
"commandMode" : "COMMAND_REDIRECT" ,
"command" : "display" ,
"redirectTo" : "scoreboard objectives setdisplay"
}
Copy schemaVersion = 1
commandMode = "COMMAND_REDIRECT"
command = "display"
redirectTo = "scoreboard objectives setdisplay"
Copy schemaVersion : 1
commandMode : COMMAND_REDIRECT
command : display
redirectTo : scoreboard objectives setdisplay