set

public Object set(int index, Object tag)

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.