The bug
Debug trace files generated by /debug function <name> print a command message started with [M] and an error message started with [E] as-is. Since debug traces have syntax with offside rule, which depends on indentation or line breaks, printing these messages as-is can break their syntax.
For example, an mcfunction mc-235674:test-1 with the following content
data get storage mc-235674: textdata get storage mc-235674: textcan produce the following debug trace
mc-235674:test-1
[C] data get storage mc-235674: text
[M] Storage mc-235674: has the following contents: "
[R = 0] data get storage mc-235674: text
"
[R = 46] data get storage mc-235674: textmc-235674:test-1
[C] data get storage mc-235674: text
[M] Storage mc-235674: has the following contents: "
[R = 0] data get storage mc-235674: text
"
[R = 46] data get storage mc-235674: textAs you can see, the text tag has line breaks and disguises itself as if it were the correct output. A naïve parser would mistake the result for [R = 0], or treat it as invalid debug trace.
For another example, let's assume a command foo. Debug-tracing the following function mc-235674:test-2
foo
foofoo
foocan produce the following output
mc-235674:test-2
[C] foo
[M] foo
[R = 0] foo
[C] foo
[M] foo
[R = 1] foo
[C] foo
[M] foo
[R = 2] foomc-235674:test-2
[C] foo
[M] foo
[R = 0] foo
[C] foo
[M] foo
[R = 1] foo
[C] foo
[M] foo
[R = 2] fooSince technically the message of the command can be arbitrary string, we can interpret the output in two ways.
One interpretation is as follows:
mc-235674:test-2
[C] foo
[M] ⟦foo
[R = 0] foo
[C] foo
[M] foo⟧
[R = 1] foo
[C] foo
[M] foo
[R = 2] foomc-235674:test-2
[C] foo
[M] ⟦foo
[R = 0] foo
[C] foo
[M] foo⟧
[R = 1] foo
[C] foo
[M] foo
[R = 2] foowhere the section enclosed in ⟦⟧ is the message of the foo. In this case, the results are 1 and 2.
The other interpretation is as follows:
mc-235674:test-2
[C] foo
[M] foo
[R = 0] foo
[C] foo
[M] ⟦foo
[R = 1] foo
[C] foo
[M] foo⟧
[R = 2] foomc-235674:test-2
[C] foo
[M] foo
[R = 0] foo
[C] foo
[M] ⟦foo
[R = 1] foo
[C] foo
[M] foo⟧
[R = 2] fooIn this case, the results are 0 and 2.
This means that we cannot inspect debug traces unambiguously, without knowledge of the internal implementation.
We do not have enough information to reproduce this issue.
Please include the following information to help us understand your problem:
Please also attach any needed commands, datapacks, resourcepacks, screenshots, videos, or worlds needed to help reproduce this issue.
Refer to the Bug Tracker Guidelines for more information about how to write helpful bug reports. Bug reports with insufficient information may be closed as Incomplete.
This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki