add

public boolean add(Object tag)

Appends a nameless NBT tag to the end of the list.

Throws

If the tag, when converted to an NBT value, has 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 tag is null.


public void add(int index, Object tag)

Inserts a nameless NBT tag at the index in the list. This will cause any tags previously at or beyond that index to be shifted up one index.

Parameters

index

The zero-based index in the list where the new tag will be inserted.

Throws

If the tag, when converted to an NBT value, has 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 tag is null.