Affects Version/s: Minecraft 18w50a, Minecraft 19w02a
Fix Version/s: Minecraft 19w03a
- Place a chest and fill it with stone.
- Stand on the chest and try to remove the stone with this command:
- Open the chest.
→ Every second item was not removed
This occurs with all kinds of NBT lists, and is not an artifact of the NBT saving/loading into memory – try a custom tag in an item tag where NBT remains pure, and the same problem occurs. The remaining items require additional /data remove commands to fully eliminate.
If the list contains any element that does not match the filter, the next match will be removed properly. Therefore, sub-sequences of matching elements are affected.
The reason for this is that the indexing does not account for the modified size of the list after an element is removed. The relevant function is used for more operations than removing, so the best fix is to traversing the list in reverse order, rather than subtracting from the index after success.