Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-268160

The success of "/function #tag" is inconsistent when the number of functions in the tag changes

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.4, 24w04a, 24w05b
    • None
    • Confirmed
    • Commands, Data Packs

      If there's only one function in the tag:

      • If there's no /return command, the "/function #tag" is void, having no success value.
      • Otherwise, the success of "/function #tag" is whether the /return command in the function returns a failure or success.

      If there're multiple functions in the tag:

      • If there's no /return command in any function, the "/function #tag" is void, having no success value.
      • Otherwise, the success of "/function #tag" is always true.

      How to reproduce:

      1. Download and enable the attached data pack. In which, there're two functions and three tags. The two functions (a, b) are exactly the same, and both return a failure with a /return command. The three tags include function a, b, a&b, respectively.
      2. Run /execute store success storage name path int 1 run function #a
      3. Run /data get storage name path
      4. Found that it's 0. Because the /return returns a failure.
      5. Run /execute store success storage name path int 1 run function #b
      6. Run /data get storage name path
      7. Found that it's 0. Because the /return returns a failure.
      8. Run /execute store success storage name path int 1 run function #anb
      9. Run /data get storage name path
      10. Found that it's 1. Though both /return commands return a failure.

            Unassigned Unassigned
            Chixvv Dl
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: