/return Command in Minecraft Java Edition

Return Values and Run Commands with Return

Java EditionLogic & ScoreboardPermission: Level 2Added in 1.20

The /return command in Minecraft Java Edition lets you return a specific whole number, report a failure, or run another command. It requires a permission level of 2, which means you need operator status or cheats turned on in single-player.

This command was first added in version 1.20 with just the value option. Later, in version 1.20.3, the syntax expanded to include the fail and run options that are still used in version 26.3.

Syntax (Java 26.3, 3 forms)

  1. /return <value>
  2. /return fail
  3. /return run <any command>

The forms you will use most

/return <value>
Returns a specific positive or negative whole number.
/return fail
Returns a failure status directly.
/return run <any command>
Runs another command through the return command.

Arguments

ArgumentTypeWhat it means
<value>whole numberA positive or negative whole number, such as 5 or -3.

Examples

Version history

Measured from the game files of every Java release from 1.13 to 26.3.

  1. 1.20.3 Syntax changed.
    + /return fail+ /return run <command>
  2. 1.20 Command added.

Tips

Common mistakes

Java vs Bedrock

Minecraft Bedrock Edition does not have the /return command, as it is exclusive to Java Edition.

FAQ

When was the /return command added to Minecraft?

The command was added to Minecraft Java Edition in version 1.20, and the fail and run syntax forms were added in version 1.20.3.

Can I use the /return command in Bedrock Edition?

No, Bedrock Edition does not have a command with this name.

What permission level is needed for /return?

You need permission level 2, which means you must be an operator on a server or have cheats turned on in single-player.

Related commands

/bossbar/data/execute/function/random/schedule/scoreboard/tag/team/trigger