-
Bug
-
Resolution: Unresolved
-
None
-
1.19.2
-
None
-
Confirmed
-
Commands
-
Normal
-
Platform
As we know, the nbt selector argument is expensive because it involves serializing the entity's data. This only needs to be done once, but if the argument is used multiple times, serialization is performed multiple times unnecessarily, becoming even more expensive.
How to reproduce
Put the following commands in repeating command blocks:
/execute if entity @e[nbt={}] /execute if entity @e[nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={},nbt={}]
Expected result
Both commands have near-identical performance
Observed result
The second command grinds the server to a halt
Important note
Obviously, multiple nbt= arguments can be combined, avoiding this issue. However, the negated form, nbt=!, cannot be combined without altering behavior. That is where this issue will be unavoidable