Affects Version/s: Minecraft 18w06a, Minecraft 18w07c, Minecraft 1.13-pre1, Minecraft 1.13, Minecraft 1.13.1, 1.15.1, 1.15.2 Pre-release 2, 1.16.3
Fix Version/s: None
The new /execute command gives detailed control over the command context given to a command that is to be executed. However, the way command contexts are computed doesn't account for the fact that command context may change in iterations of the outer loop and should then be different in subsequent iterations.
For many use-cases this is perfectly fine because the command context rarely (intentionally) changes. However, for some applications this is not sufficient. Consider the following command, ran when exactly one player and a couple of other entities are in the game:
Expected behavior: the player is teleported one block for each entity in the world. If there are 10 armor stands and the player, the player should be teleported 11 blocks. Actual behavior: the player is teleported one block. A reproduction case not involving teleportation can be found in this comment.
The following is a simplified, pseudo code interpretation of how /execute looping is understood to work with this command:
Instead, it should work somewhat like this:
Note that the implementation of /execute wasn't looked at in detail for this ticket, so it contains a healthy dose of speculation.