/execute if items
command can specify multiple targets and multiple slots, and returns the sum of all detected items as a result. However, if this result exceeds the int maximum (2147483647), it will overflow to a negative number and cause other unusual behaviors.
/execute if items ...
Fails when sum > 2147483647, which is ❌
/execute if items ... run ...
Fails when sum > 2147483647, which is ❌
/execute unless items ...
Fails when sum > 2147483647, which is ✔
/execute unless items ... run ...
Succeeds when sum > 2147483647, which is ❌
Due to the massive number of entities, you'll need at least 4GB of memory to reproduce this.
In the attached world file, run the command blocks.
(Wait about ~3 minutes...)
See the output message or SuccessCount value of the
/execute if|unless items
commands.
Attachments
Comments 2
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
Can confirm.