Mojira Archive
MC-264842

return run function <function> fails

While in a datapack .mcfunction file, the command "return run function <function>" returns 0 without executing the function. When running the same command in chat, the function is called as expected. Example:

// --- glitch.mcfunction ---

say glitch/entry
return run function example:glitch2
say glitch/exit

// --- glitch2.mcfunction ---

say glitch2/entry
return 1

When running "/function example:glitch" in chat, this is printed:

Function 'example:glitch' returned 0
[mega12345mega] glitch/entry

I would have expected this to be printed instead:

Function 'example:glitch' returned 1
[mega12345mega] glitch/entry
[mega12345mega] glitch2/entry

When running "/return run function example:glitch2" in chat, this is printed (as expected):

Function 'example:glitch2' returned 1
[mega12345mega] glitch2/entry

 

If glitch.mcfunction replaces "return run function example:glitch2" with "return run say glitch2/entry", then "glitch2/entry" is printed out in chat as expected. This gives the exact messages that I mentioned above under the section "I would have expected this to be printed instead".

Duplicate

mega12345mega

2023-08-14, 09:30 AM

2023-08-14, 09:06 PM

2023-08-14, 09:06 PM

0

2

Unconfirmed

(Unassigned)

command

23w32a

-