<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.sasgaming.net/index.php?action=history&amp;feed=atom&amp;title=Minecraft%3ACommands%2Freturn</id>
	<title>Minecraft:Commands/return - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.sasgaming.net/index.php?action=history&amp;feed=atom&amp;title=Minecraft%3ACommands%2Freturn"/>
	<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Commands/return&amp;action=history"/>
	<updated>2026-04-09T23:08:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki.sasgaming.net/index.php?title=Minecraft:Commands/return&amp;diff=75730&amp;oldid=prev</id>
		<title>SyncBot: Fix template calls: add MC/ prefix</title>
		<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Commands/return&amp;diff=75730&amp;oldid=prev"/>
		<updated>2026-04-09T20:13:04Z</updated>

		<summary type="html">&lt;p&gt;Fix template calls: add MC/ prefix&lt;/p&gt;
&lt;a href=&quot;https://wiki.sasgaming.net/index.php?title=Minecraft:Commands/return&amp;amp;diff=75730&amp;amp;oldid=69122&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>SyncBot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sasgaming.net/index.php?title=Minecraft:Commands/return&amp;diff=69122&amp;oldid=prev</id>
		<title>SyncBot: Remove broken links to missing pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Commands/return&amp;diff=69122&amp;oldid=prev"/>
		<updated>2026-04-09T15:45:05Z</updated>

		<summary type="html">&lt;p&gt;Remove broken links to missing pages&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:45, 9 April 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l4&quot;&gt;Line 4:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 4:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|oplevel=2&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|oplevel=2&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A command that can be embedded inside a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Minecraft:Function (Java Edition)|&lt;/del&gt;function&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]] &lt;/del&gt;to control its execution.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A command that can be embedded inside a function to control its execution.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It ends function execution and sets the successfulness and the return value of the function, which is returned to the {{cmd|function}} command as its [[Minecraft:Commands/function#Output|output values]], or the {{cmd|execute if function ...}} command to test.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;It ends function execution and sets the successfulness and the return value of the function, which is returned to the {{cmd|function}} command as its [[Minecraft:Commands/function#Output|output values]], or the {{cmd|execute if function ...}} command to test.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l93&quot;&gt;Line 93:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 93:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Navbox commands}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Navbox commands}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Minecraft:&lt;/del&gt;de:Befehl/return&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;de:Befehl/return&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Minecraft:&lt;/del&gt;ja:コマンド/return&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ja:コマンド/return&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Minecraft:&lt;/del&gt;lzh:令/return&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;lzh:令/return&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Minecraft:&lt;/del&gt;pt:Comandos/return&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;pt:Comandos/return&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Minecraft:&lt;/del&gt;zh:命令/return&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;zh:命令/return&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>SyncBot</name></author>
	</entry>
	<entry>
		<id>https://wiki.sasgaming.net/index.php?title=Minecraft:Commands/return&amp;diff=49769&amp;oldid=prev</id>
		<title>imported&gt;Chixvv: /* Usage */</title>
		<link rel="alternate" type="text/html" href="https://wiki.sasgaming.net/index.php?title=Minecraft:Commands/return&amp;diff=49769&amp;oldid=prev"/>
		<updated>2024-08-04T09:42:08Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Usage&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{exclusive|java}}&lt;br /&gt;
{{Infobox command&lt;br /&gt;
|name=return&lt;br /&gt;
|oplevel=2&lt;br /&gt;
}}&lt;br /&gt;
A command that can be embedded inside a [[Minecraft:Function (Java Edition)|function]] to control its execution.&lt;br /&gt;
&lt;br /&gt;
It ends function execution and sets the successfulness and the return value of the function, which is returned to the {{cmd|function}} command as its [[Minecraft:Commands/function#Output|output values]], or the {{cmd|execute if function ...}} command to test.&lt;br /&gt;
&lt;br /&gt;
It can also end a forking {{cmd|execute}} command that has multiple [[Minecraft:Commands/execute#Subcommands and forking|branches]] at the first branch.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
By placing this command in a function, the function can be stopped at a certain line, and the return value and the successfulness of the function are set.&lt;br /&gt;
* If the function is called by a {{cmd|function}} command, the &amp;#039;&amp;#039;&amp;#039;return value&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;successfulness&amp;#039;&amp;#039;&amp;#039; are returned to the {{cmd|function}} command as its [[Minecraft:Commands/function#Output|output values]], and then can be stored using {{cmd|execute store}}.&lt;br /&gt;
* If the function is called by a {{cmd|execute if function}} command, the &amp;#039;&amp;#039;&amp;#039;return value&amp;#039;&amp;#039;&amp;#039; is checked whether it is not &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Like other commands, following a {{cmd|execute (if{{!}}unless) ... run}} or a forking {{cmd|execute}} command that may [[Minecraft:Commands/execute#Subcommands and forking|terminate]], this command can be restricted to only execute under certain conditions. With this, under different conditions a function can end at different lines, thus achieving more complex behaviors. For example, the following function simulates an if-else statement:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;mcfunction&amp;quot;&amp;gt;&lt;br /&gt;
# if (@s[tag=test1]) then return function(&amp;quot;test1&amp;quot;)&lt;br /&gt;
execute if entity @s[tag=test1] run return run function test1&lt;br /&gt;
# else if (@s[type=player]) then return function(&amp;quot;test2&amp;quot;)&lt;br /&gt;
execute if entity @s[type=player] run return run function test2&lt;br /&gt;
# else return function(&amp;quot;test3&amp;quot;)&lt;br /&gt;
return run function test3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Following a forking {{cmd|execute}} command that has multiple [[Minecraft:Commands/execute#Subcommands and forking|branches]], the {{cmd|execute}} command also ends after the first execution of the {{cmd|return|link=none}} command. So, only the first branch is executed. This can be used to ensure a command is executed only once. For example: &amp;lt;code&amp;gt;/execute as @e[type=zombie,sort=nearest] at @s if block ~ ~-1 ~ grass_block run &amp;#039;&amp;#039;&amp;#039;return run&amp;#039;&amp;#039;&amp;#039; tp @s Steve&amp;lt;/code&amp;gt; teleports the nearest one zombie that is on a grass block to Steve, if such a zombie exists. Note this command in a function also ends the function.&lt;br /&gt;
&lt;br /&gt;
Followed by a forking {{cmd|execute}} command that has multiple [[Minecraft:Commands/execute#Subcommands and forking|branches]], the {{cmd|execute}} command also ends after the first branch execution.&lt;br /&gt;
&lt;br /&gt;
The only difference between &amp;lt;code&amp;gt;return run execute ... run &amp;lt;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;execute ... run return run &amp;lt;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;gt;&amp;lt;/code&amp;gt; is that in the first instance, the {{cmd|return|link=none}} command always executes, and it returns a failure and a &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; value when the {{cmd|execute}} command terminates; While the {{cmd|return|link=none}} command in the second instance does not execute when the {{cmd|execute}} command terminates.&lt;br /&gt;
&lt;br /&gt;
Followed by a {{cmd|function}} command that calls multiple functions in a tag, the whole {{cmd|function}} command also ends after the first execution of the {{cmd|return|link=none}} command in any of the functions. See also the {{cmd|function}} article.&lt;br /&gt;
&lt;br /&gt;
The {{cmd|return|link=none}} command sets the return value and the successfulness of a function if it is executed in the function. They are returned to the {{cmd|function}} or the {{cmd|execute if function ...}} command that is calling the function. However, the {{cmd|return|link=none}} command itself also has its [[#Output|output values]]. Following a {{cmd|execute store ... run}} command, its &amp;lt;code&amp;gt;success&amp;lt;/code&amp;gt; value and &amp;lt;code&amp;gt;result&amp;lt;/code&amp;gt; value of the {{cmd|return|link=none}} command can be stored while it ends the {{cmd|execute}} command and the function. Directly executed in a command block, the success count of the {{cmd|return|link=none}} command is recorded by the command block.&lt;br /&gt;
&lt;br /&gt;
== Syntax ==&lt;br /&gt;
&amp;lt;code&amp;gt;return &amp;lt;value&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:Ends the function to which it belongs with a success, and sets the return value of the function to the specified integer value.&lt;br /&gt;
&amp;lt;code&amp;gt;return fail&amp;lt;/code&amp;gt;&lt;br /&gt;
:Ends the function with a failure and a return value of &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;code&amp;gt;return run &amp;lt;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
:Executes the command specified in &amp;lt;code&amp;gt;&amp;lt;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;gt;&amp;lt;/code&amp;gt;, ends the function to which it belongs, and sets the &amp;#039;&amp;#039;&amp;#039;successfulness&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;return value&amp;#039;&amp;#039;&amp;#039; of the function to the &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;success&amp;lt;/code&amp;gt; value&amp;#039;&amp;#039;&amp;#039; and &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;result&amp;lt;/code&amp;gt; value&amp;#039;&amp;#039;&amp;#039; of that command. If the command is a forking {{cmd|execute}}, only the first branch is executed.&lt;br /&gt;
&lt;br /&gt;
== Arguments ==&lt;br /&gt;
{{argument|value|integer}}&lt;br /&gt;
: An integer value to use as the return value of the {{cd|function}}.&lt;br /&gt;
: {{arg desc|je=integer}}&lt;br /&gt;
{{argument|&amp;#039;&amp;#039;command&amp;#039;&amp;#039;}}&lt;br /&gt;
: A command to execute.&lt;br /&gt;
&lt;br /&gt;
== Result ==&lt;br /&gt;
{{Result table|onlyje=1}}&lt;br /&gt;
{{Result table|The command is incomplete, or any argument is not specified correctly.|unparseable}}&lt;br /&gt;
{{Result table|cmd=/return fail|Always.|fail}}&lt;br /&gt;
{{Result table|cmd=/return run &amp;lt;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;gt;|the {{cd|&amp;lt;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;gt;}} fails (If the command is an {{cmd|execute}} command, the first branch fails)}}&lt;br /&gt;
{{Result table|the {{cd|&amp;lt;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;gt;}} is {{cmd|execute}}, and the {{cmd|execute}} command [[Minecraft:Commands/execute#Subcommands and forking|terminates]]}}&lt;br /&gt;
{{Result table|the {{cd|&amp;lt;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;gt;}} is {{cmd|function}}, and the {{cmd|function}} command is [[Minecraft:Commands/function#Result|void]]}}&lt;br /&gt;
{{Result table|the {{cd|&amp;lt;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;gt;}} is {{cmd|execute ... run function}}, and the {{cmd|function}} command in the first branch of {{cmd|execute}} command is void}}&lt;br /&gt;
{{Result table|cmd=|succeed}}&lt;br /&gt;
{{Result table}}&lt;br /&gt;
&lt;br /&gt;
== Output ==&lt;br /&gt;
{{Output table|onlyje=1}}&lt;br /&gt;
{{Output table|edition=je|cmd=/return &amp;lt;value&amp;gt;|On success|1|1|the value of {{cd|&amp;lt;value&amp;gt;}}.}}&lt;br /&gt;
{{Output table|cmd=/return fail|On fail|0|0|0}}&lt;br /&gt;
{{Output table|cmd=/return run &amp;lt;&amp;#039;&amp;#039;command&amp;#039;&amp;#039;&amp;gt;|On fail|0|0|0}}&lt;br /&gt;
{{Output table|On success|1|1|the &amp;lt;code&amp;gt;result&amp;lt;/code&amp;gt; value of {{cd|&amp;lt;command&amp;gt;}}. (If the command is {{cmd|execute}}, the &amp;lt;code&amp;gt;result&amp;lt;/code&amp;gt; value of the first branch)}}&lt;br /&gt;
{{Output table}}&lt;br /&gt;
&lt;br /&gt;
Above are the outputs of the {{cmd|return|link=none}} command itself. And the successfulness and the return value of the function are also set if the {{cmd|return|link=none}} command is executed in a function. The successfulness of the function equals to the &amp;lt;code&amp;gt;success&amp;lt;/code&amp;gt; value of the {{cmd|return|link=none}} command. The return value of the function equals to the &amp;lt;code&amp;gt;result&amp;lt;/code&amp;gt; value of the {{cmd|return|link=none}} command.&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
{{HistoryTable&lt;br /&gt;
|{{HistoryLine|java}}&lt;br /&gt;
|{{HistoryLine||1.20|dev=23w16a|Added {{cd|return}}.}}&lt;br /&gt;
|{{HistoryLine||1.20.2|dev=23w31a|Added a new subcommand &amp;lt;code&amp;gt;run&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
|{{HistoryLine|||dev=1.20.2 Pre-release 1|Temporarily removed syntax {{cmd|link=none|return run}}.}}&lt;br /&gt;
|{{HistoryLine||1.20.3|dev=23w41a|Reintroduced subcommand &amp;lt;code&amp;gt;run&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
|{{HistoryLine|||dev=23w44a|If {{cmd|link=none|function &amp;lt;&amp;#039;&amp;#039;function tag&amp;#039;&amp;#039;&amp;gt;}} runs multiple functions in combination with {{cmd|link=none|return run}}, execution stops after first {{cmd|link=none|return}} in any of the functions.&lt;br /&gt;
|A single call to the {{cmd|link=none|function}} command always returns when run with {{cmd|link=none|return run}}. For example, {{cmd|link=none|return run execute &amp;#039;&amp;#039;[split context]&amp;#039;&amp;#039; run function &amp;#039;&amp;#039;&amp;lt;some function with conditional return&amp;gt;&amp;#039;&amp;#039;}} always returns after processing the first context.&lt;br /&gt;
|Added subcommand &amp;lt;code&amp;gt;fail&amp;lt;/code&amp;gt;.&lt;br /&gt;
|{{cmd|link=none|return run}} now always returns. If there are no valid results from returned command, function containing {{cmd|link=none|return run}} fails.&lt;br /&gt;
|{{cmd|link=none|return run}} now propagates success value together with results value (previously it always set success to &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;).&lt;br /&gt;
|{{cmd|link=none|return run}} now also allows storing values, which means {{cmd|link=none|execute store ... run return run &amp;#039;&amp;#039;some_command&amp;#039;&amp;#039;}} both stores value and returns it outside function.}}&lt;br /&gt;
|{{HistoryLine||1.20.5|dev=23w51a|Fixed a bug that &amp;lt;code&amp;gt;/return run function &amp;lt;function&amp;gt;&amp;lt;/code&amp;gt; does not return under some conditions.&amp;lt;ref&amp;gt;{{bug|MC-267194|||fixed}}&amp;lt;/ref&amp;gt;}}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Navigation ==&lt;br /&gt;
{{Navbox commands}}&lt;br /&gt;
&lt;br /&gt;
[[Minecraft:de:Befehl/return]]&lt;br /&gt;
[[Minecraft:ja:コマンド/return]]&lt;br /&gt;
[[Minecraft:lzh:令/return]]&lt;br /&gt;
[[Minecraft:pt:Comandos/return]]&lt;br /&gt;
[[Minecraft:zh:命令/return]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Chixvv</name></author>
	</entry>
</feed>