Redirect without arguments

When using the COMMAND_REDIRECT_NOARG command mode, it creates a new command alias that redirects to an existing command without its trailing command arguments.

Create a command alias using COMMAND_REDIRECT_NOARG

To begin, we must set our command mode to COMMAND_REDIRECT_NOARG.

  • JSON or JSON5

{
    "schemaVersion": 1,
    "commandMode": "COMMAND_REDIRECT_NOARG"
}
  • TOML

schemaVersion = 1
commandMode = "COMMAND_REDIRECT_NOARG"
  • YAML

schemaVersion: 1
commandMode: COMMAND_REDIRECT_NOARG

With the command mode set, we can now define our new command.

  • JSON or JSON5

{
    "schemaVersion": 1,
    "commandMode": "COMMAND_REDIRECT_NOARG",
    "command": "easy"
}
  • TOML

schemaVersion = 1
commandMode = "COMMAND_REDIRECT_NOARG"
command = "easy"
  • YAML

schemaVersion: 1
commandMode: COMMAND_REDIRECT_NOARG
command: easy

Finally, we must choose the existing command that our new command will redirect to. In this case, I have chosen the /difficulty easy command.

  • JSON or JSON5

{
    "schemaVersion": 1,
    "commandMode": "COMMAND_REDIRECT_NOARG",
    "command": "easy",
    "redirectTo": "difficulty easy"
}
  • TOML

schemaVersion = 1
commandMode = "COMMAND_REDIRECT_NOARG"
command = "easy"
redirectTo = "difficulty easy"
  • YAML

schemaVersion: 1
commandMode: COMMAND_REDIRECT_NOARG
command: easy
redirectTo: difficulty easy

Next, let's create another one for the /gamemode survival command.

  • JSON or JSON5

{
    "schemaVersion": 1,
    "commandMode": "COMMAND_REDIRECT_NOARG",
    "command": "gm 0",
    "redirectTo": "gamemode survival"
}
  • TOML

schemaVersion = 1
commandMode = "COMMAND_REDIRECT_NOARG"
command = "gm 0"
redirectTo = "gamemode survival"
  • YAML

schemaVersion: 1
commandMode: COMMAND_REDIRECT_NOARG
command: gm 0
redirectTo: gamemode survival

Examples

Time Command

Day

  • JSON or JSON5

{
    "schemaVersion": 1,
    "commandMode": "COMMAND_REDIRECT_NOARG",
    "command": "day",
    "redirectTo": "time set day"
}
  • TOML

schemaVersion = 1
commandMode = "COMMAND_REDIRECT_NOARG"
command = "day"
redirectTo = "time set day"
  • YAML

schemaVersion: 1
commandMode: COMMAND_REDIRECT_NOARG
command: day
redirectTo: time set day

Night

  • JSON or JSON5

{
    "schemaVersion": 1,
    "commandMode": "COMMAND_REDIRECT_NOARG",
    "command": "night",
    "redirectTo": "time set night"
}
  • TOML

schemaVersion = 1
commandMode = "COMMAND_REDIRECT_NOARG"
command = "night"
redirectTo = "time set night"
  • YAML

schemaVersion: 1
commandMode: COMMAND_REDIRECT_NOARG
command: night
redirectTo: time set night

Game Mode Command (1.19.2 and below)

Survival

  • JSON or JSON5

{
    "schemaVersion": 1,
    "commandMode": "COMMAND_REDIRECT_NOARG",
    "command": "gm 0",
    "redirectTo": "gamemode survival"
}
  • TOML

schemaVersion = 1
commandMode = "COMMAND_REDIRECT_NOARG"
command = "gm 0"
redirectTo = "gamemode survival"
  • YAML

schemaVersion: 1
commandMode: COMMAND_REDIRECT_NOARG
command: gm 0
redirectTo: gamemode survival

Creative

  • JSON or JSON5

{
    "schemaVersion": 1,
    "commandMode": "COMMAND_REDIRECT_NOARG",
    "command": "gm 1",
    "redirectTo": "gamemode creative"
}
  • TOML

schemaVersion = 1
commandMode = "COMMAND_REDIRECT_NOARG"
command = "gm 1"
redirectTo = "gamemode creative"
  • YAML

schemaVersion: 1
commandMode: COMMAND_REDIRECT_NOARG
command: gm 1
redirectTo: gamemode creative

Adventure

  • JSON or JSON5

{
    "schemaVersion": 1,
    "commandMode": "COMMAND_REDIRECT_NOARG",
    "command": "gm 2",
    "redirectTo": "gamemode adventure"
}
  • TOML

schemaVersion = 1
commandMode = "COMMAND_REDIRECT_NOARG"
command = "gm 2"
redirectTo = "gamemode adventure"
  • YAML

schemaVersion: 1
commandMode: COMMAND_REDIRECT_NOARG
command: gm 2
redirectTo: gamemode adventure

Spectator

  • JSON or JSON5

{
    "schemaVersion": 1,
    "commandMode": "COMMAND_REDIRECT_NOARG",
    "command": "gm 3",
    "redirectTo": "gamemode spectator"
}
  • TOML

schemaVersion = 1
commandMode = "COMMAND_REDIRECT_NOARG"
command = "gm 3"
redirectTo = "gamemode spectator"
  • YAML

schemaVersion: 1
commandMode: COMMAND_REDIRECT_NOARG
command: gm 3
redirectTo: gamemode spectator

Difficulty Command

Peaceful

  • JSON or JSON5

{
    "schemaVersion": 1,
    "commandMode": "COMMAND_REDIRECT_NOARG",
    "command": "peaceful",
    "redirectTo": "difficulty peaceful"
}
  • TOML

schemaVersion = 1
commandMode = "COMMAND_REDIRECT_NOARG"
command = "peaceful"
redirectTo = "difficulty peaceful"
  • YAML

schemaVersion: 1
commandMode: COMMAND_REDIRECT_NOARG
command: peaceful
redirectTo: difficulty peaceful

Easy

  • JSON or JSON5

{
    "schemaVersion": 1,
    "commandMode": "COMMAND_REDIRECT_NOARG",
    "command": "easy",
    "redirectTo": "difficulty easy"
}
  • TOML

schemaVersion = 1
commandMode = "COMMAND_REDIRECT_NOARG"
command = "easy"
redirectTo = "difficulty easy"
  • YAML

schemaVersion: 1
commandMode: COMMAND_REDIRECT_NOARG
command: easy
redirectTo: difficulty easy

Normal

  • JSON or JSON5

{
    "schemaVersion": 1,
    "commandMode": "COMMAND_REDIRECT_NOARG",
    "command": "normal",
    "redirectTo": "difficulty normal"
}
  • TOML

schemaVersion = 1
commandMode = "COMMAND_REDIRECT_NOARG"
command = "normal"
redirectTo = "difficulty normal"
  • YAML

schemaVersion: 1
commandMode: COMMAND_REDIRECT_NOARG
command: normal
redirectTo: difficulty normal

Hard

  • JSON or JSON5

{
    "schemaVersion": 1,
    "commandMode": "COMMAND_REDIRECT_NOARG",
    "command": "hard",
    "redirectTo": "difficulty hard"
}
  • TOML

schemaVersion = 1
commandMode = "COMMAND_REDIRECT_NOARG"
command = "hard"
redirectTo = "difficulty hard"
  • YAML

schemaVersion: 1
commandMode: COMMAND_REDIRECT_NOARG
command: hard
redirectTo: difficulty hard

Last updated