Interface Tag<T>

All Known Subinterfaces:
Tag.Identified<T>
All Known Implementing Classes:
RequiredTagList.TagWrapper, SetTag

public interface Tag<T>
A tag is a set of objects.

Tags simplifies reference to multiple objects, especially for predicate (testing against) purposes.

A tag is immutable by design. It has a builder, which is a mutable equivalent.

Its entries' iteration may be ordered or unordered, depending on the configuration from the tag builder.

  • Method Details

    • codec

      static <T> com.mojang.serialization.Codec<Tag<T>> codec​(Supplier<TagGroup<T>> groupGetter)
    • contains

      boolean contains​(T entry)
    • values

      List<T> values()
    • getRandom

      default T getRandom​(Random random)
    • of

      static <T> Tag<T> of​(Set<T> values)