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.

Mappings:
Namespace Name
official afc
intermediary net/minecraft/class_3494
named net/minecraft/tag/Tag
  • Method Details

    • codec

      static <T> com.mojang.serialization.Codec<Tag<T>> codec​(Supplier<TagGroup<T>> groupGetter)
      Mappings:
      Namespace Name Mixin selector
      official a Lafc;a(Ljava/util/function/Supplier;)Lcom/mojang/serialization/Codec;
      intermediary method_28134 Lnet/minecraft/class_3494;method_28134(Ljava/util/function/Supplier;)Lcom/mojang/serialization/Codec;
      named codec Lnet/minecraft/tag/Tag;codec(Ljava/util/function/Supplier;)Lcom/mojang/serialization/Codec;
    • contains

      boolean contains​(T entry)
      Mappings:
      Namespace Name Mixin selector
      official a Lafc;a(Ljava/lang/Object;)Z
      intermediary method_15141 Lnet/minecraft/class_3494;method_15141(Ljava/lang/Object;)Z
      named contains Lnet/minecraft/tag/Tag;contains(Ljava/lang/Object;)Z
    • values

      List<T> values()
      Mappings:
      Namespace Name Mixin selector
      official b Lafc;b()Ljava/util/List;
      intermediary method_15138 Lnet/minecraft/class_3494;method_15138()Ljava/util/List;
      named values Lnet/minecraft/tag/Tag;values()Ljava/util/List;
    • getRandom

      default T getRandom​(Random random)
      Mappings:
      Namespace Name Mixin selector
      official a Lafc;a(Ljava/util/Random;)Ljava/lang/Object;
      intermediary method_15142 Lnet/minecraft/class_3494;method_15142(Ljava/util/Random;)Ljava/lang/Object;
      named getRandom Lnet/minecraft/tag/Tag;getRandom(Ljava/util/Random;)Ljava/lang/Object;
    • of

      static <T> Tag<T> of​(Set<T> values)
      Mappings:
      Namespace Name Mixin selector
      official b Lafc;b(Ljava/util/Set;)Lafc;
      intermediary method_26777 Lnet/minecraft/class_3494;method_26777(Ljava/util/Set;)Lnet/minecraft/class_3494;
      named of Lnet/minecraft/tag/Tag;of(Ljava/util/Set;)Lnet/minecraft/tag/Tag;