addAll

public boolean addAll(Collection<? extends Object> tags)

Appends any provided NBT tags to the end of the list.

Throws

If any of the supplied tags, when converted to an NBT value, have a different TagType than this list's content-type.

If the list's content type is set to TAG_End, indicating the list should always be empty.

If the supplied tags collection or any of its elements are null.


public boolean addAll(int index, Collection<? extends Object> tags)

Inserts any provided NBT tags into the list at a given index. Any tags previously at or beyond that index will have their indices increased by the added collection's size.

Parameters

index

The zero-based index in the list where the first tag in the collection will be added.

Throws

If any of the supplied tags, when converted to an NBT value, have a different TagType than this list's content-type.

If the list's content type is set to TAG_End, indicating the list should always be empty.

If the supplied tags collection or any of its elements are null.