Interface ITag<V>

All Superinterfaces:
Iterable<V>
All Known Implementing Classes:
ForgeRegistryTag

public interface ITag<V> extends Iterable<V>
A tag is a collection of elements with an identifying tag key. For Forge, these are bound on world load. Tags will always be empty until they are bound. A tag instance provided for a given TagKey from a given ITagManager will always return the same instance on future invocations. This means that the same tag instance will be rebound across reloads assuming the same registry instance is in use. It is safe to store instances of this class for long periods of time.
  • Method Details

    • getKey

      TagKey<V> getKey()
    • stream

      Stream<V> stream()
    • isEmpty

      boolean isEmpty()
    • size

      int size()
    • contains

      boolean contains(V value)
    • getRandomElement

      Optional<V> getRandomElement(Random random)
    • isBound

      boolean isBound()
      Returns:
      true if this tag was loaded with a value (including empty), otherwise the tag is always empty and this returns false