A crash occurs when a command that contains selectors or message arguments is executed within a function that is currently in a deep recursion stack (about 100000+ calls). While these two argument types are what I've found so far, I haven't checked every command, so I'm not certain if they are the only ones.
In my case, I encountered this bug in a function that recursively checks the stopwatch value to wait for a certain amount of time. I included a single line of a tellraw command to execute upon exiting the recursion for debugging purposes, and that's what caused the game to crash.
Steps to reproduce the issue:
Create a function that recursively calls itself about 100000 times and executes a specific command (
say end
) at the end of the function itself, as shown in the example below. (Alternatively, use the attached datapacktest.zip
.)# test:recursion scoreboard objectives add test dummy scoreboard players set #t test 100000 function test:recursion-1
# test:recursion-1 scoreboard players remove #t test 1 execute if score #t test matches 0 run say END? execute if score #t test matches 1.. run function test:recursion-1
To prevent the function from being blocked by the command execution limit, run
/gamerule maxCommandChainLength 2147483647
in the chat.Run the function (
/function test:recursion
). A crash should occur. If it doesn't, the number of recursive calls needed to trigger the bug might vary depending on your environment, so try increasing the recursion count.To see if it can also be reproduced with a selector, try replacing the command
say END?
with any command that includes a selector, likedata get entity @s
Thank you for your report!
After consideration, the issue is being closed as Won't Fix.
Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki