default @NotNull ListBinaryTag getList(final @Range(from = 0, to = Integer.MAX_VALUE) int index, final @Nullable BinaryTagType<?> elementType, final @NotNull ListBinaryTag defaultValue) {
    final BinaryTag tag = this.get(index);
    if (tag.type() == BinaryTagTypes.LIST) {
      final ListBinaryTag list = (ListBinaryTag) tag;
      if (elementType == null || list.elementType() == elementType) {
        return list;
      }
    }
    return defaultValue;
  }
Gets a list.

<p>If {@code elementType} is non-{@code null} and the {@link ListBinaryTag} at index {@code index} does not match, {@code defaultValue} will be returned.</p>

@param index the index
@param elementType the expected element type of the list at index {@code index}
@param defaultValue the default value
@return the list, or {@code defaultValue} if the tag at index {@code index} is not a list tag, or if the list tag's element type is not {@code elementType}
@since 4.4.0
nbt/src/main/java/net/kyori/adventure/nbt/ListBinaryTag.java