Interface TagEntry<T>

Type Parameters:
T - the type of value in the tag
All Superinterfaces:
Keyed

@Experimental @NullMarked @NonExtendable public interface TagEntry<T> extends Keyed
An entry is a pre-flattened tag. Represents either an individual registry entry or a whole tag.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns if this entry is required.
    boolean
    Returns if this entry represents a tag.
    static <T> TagEntry<T>
    tagEntry(TagKey<T> tagKey)
    Create a required tag entry for a nested tag.
    static <T> TagEntry<T>
    tagEntry(TagKey<T> tagKey, boolean isRequired)
    Create a tag entry for a nested tag.
    static <T> TagEntry<T>
    valueEntry(TypedKey<T> entryKey)
    Create required tag entry for a single value.
    static <T> TagEntry<T>
    valueEntry(TypedKey<T> entryKey, boolean isRequired)
    Create tag entry for a single value.

    Methods inherited from interface net.kyori.adventure.key.Keyed

    key
  • Method Details

    • valueEntry

      @Contract(value="_ -> new", pure=true) static <T> TagEntry<T> valueEntry(TypedKey<T> entryKey)
      Create required tag entry for a single value.
      Type Parameters:
      T - the type of value
      Parameters:
      entryKey - the key of the entry
      Returns:
      a new tag entry for a value
    • valueEntry

      @Contract(value="_, _ -> new", pure=true) static <T> TagEntry<T> valueEntry(TypedKey<T> entryKey, boolean isRequired)
      Create tag entry for a single value.
      Type Parameters:
      T - the type of value
      Parameters:
      entryKey - the key of the entry
      isRequired - if this entry is required (see isRequired())
      Returns:
      a new tag entry for a value
    • tagEntry

      @Contract(value="_ -> new", pure=true) static <T> TagEntry<T> tagEntry(TagKey<T> tagKey)
      Create a required tag entry for a nested tag.
      Type Parameters:
      T - the type of value
      Parameters:
      tagKey - they key for the tag
      Returns:
      a new tag entry for a tag
    • tagEntry

      @Contract(value="_, _ -> new", pure=true) static <T> TagEntry<T> tagEntry(TagKey<T> tagKey, boolean isRequired)
      Create a tag entry for a nested tag.
      Type Parameters:
      T - the type of value
      Parameters:
      tagKey - they key for the tag
      isRequired - if this entry is required (see isRequired())
      Returns:
      a new tag entry for a tag
    • isTag

      @Contract(pure=true) boolean isTag()
      Returns if this entry represents a tag.
      Returns:
      true if this entry is a tag, false if it is an individual entry
    • isRequired

      @Contract(pure=true) boolean isRequired()
      Returns if this entry is required. If an entry is required, the value or tag must exist on the server in order for the tag to load correctly. A missing value will prevent the tag holding that missing value from being created.
      Returns:
      true if this entry is required, false if it is optional