If a function containing /return fail is run in chat, it returns a success of 1.
How to reproduce:
The attached data pack contains a function named bugtest:fail that runs /return fail.
Run the function with an "execute store result" and an "execute store success".
Observed behavior:
In chat, the message "Function bugtest:fail returned 0" appears and the result is 0 but the success 1.
Expected behavior:
A message "Function bugtest:fail failed" or similar should appear and result and success should both be 0 indicating failure.
Linked issues
relates to 2
Attachments
Comments 5
The issue is not completely gone, the success value now seems to be assigned correctly, however, it is still not possible to distinguish between a function that failed and a function that returned 0, the message is still "Function ... returned 0", which is misleading.
Done: MC-267802
Confirmed.
Clearer steps to reproduce:
Install the attached data pack.
Run
/scoreboard objectives add Success dummy
Run
/execute store success score @s Success run function bugtest:fail
->❌ Chat returns "Function bugtest:fail returned 0"
Run
/scoreboard players get @s Success
-> ❌ Chat returns "PLAYERNAME has 1 [Success]"
Expected result:
For success 0 is stored.
For command feedback "Function bugtest:fail failed" is returned.