1.16.5, 21w19a, 1.17 Pre-release 1, 1.17, 1.17.1, 21w37a, 1.18.1, 22w03a, 22w05a, 1.18.2 Pre-release 1, 1.18.2, 22w11a, 22w12a, 1.19 Release Candidate 2, 1.19, 1.19.1, 1.19.2, 1.19.3 Release Candidate 1, 1.19.3 Release Candidate 2, 1.19.3, 23w03a, 23w05a, 1.19.4, 23w12a, 23w18a, 1.20 Pre-release 7
/data modify ... insert|prepend|append ... inserts the source elements into the target collection one by one, not in batches. Because the internal collection of list tags and array tags are java.util.ArrayList and primitive arrays respectively, this way of insertion slows down performance by repeated unnecessary resizing of the target collection.
This will be resolved by using java.util.ArrayList#addAll and org.apache.commons.lang3.ArrayUtils#addAll instead of java.util.ArrayList#add and org.apache.commons.lang3.ArrayUtils#add, respectively.
Partially related to
- relates to
MC-221421 A list tag can be modified during insertion into itself