-
Bug
-
Resolution: Fixed
-
1.19.70.23 Preview, 1.19.22 Hotfix, 1.20.51 Hotfix
-
None
-
Confirmed
-
Multiple
-
1177623
The bug
The /give and /replaceitem commands are slow even when no players are found by the selector. They're especially slow when the specified item has a lot of components, even though there was nobody to even give the item to, so no item should be generated.
How to reproduce
- Download and open the attached world
- Pull the levers next to the command blocks (the two marked with blue concrete are the most important), one at a time
- Observe the server performance for each:
- The one on the left tries to give a sword to a non-existent player, 30,000 times per tick
- The one on the right tries to execute as a non-existent player to give themselves a sword, 30,000 times per tick
Expected behavior
Server performance is identical
Observed behavior
Left command blocks tank the server, right slows it only a bit