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

return run function <function> fails

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 23w32a
    • Unconfirmed
    • (Unassigned)

      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".

            Unassigned Unassigned
            mega12345mega mega12345mega
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: