Interface MCTag

All Superinterfaces:
CommandStringDisplayable, Comparable<MCTag>
All Known Implementing Classes:
KnownTag, UnknownTag

@ZenRegister(loaders={"crafttweaker","tags"}) public interface MCTag extends CommandStringDisplayable, Comparable<MCTag>
DocParam:
this invalid input: '<'tag:item:minecraft:wool>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Comparator<MCTag>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    add(MCTag... tags)
    Adds the given tags to this tag.
    default void
    addId(net.minecraft.resources.ResourceLocation... elements)
    Adds the elements that correspond to the given ResourceLocation to this tag.
    default void
    Removes all elements in this tag.
    default int
     
    default boolean
    contains(net.minecraft.resources.ResourceLocation id)
    Checks if this tag contains an element with the given id
    default boolean
    equals(MCTag other)
    Checks if this tag equals the other tag.
    default boolean
    Checks if this tag exists.
    default String
    Returns the BEP to get this thingy
    default <T extends Collection<net.minecraft.core.Holder<?>>>
    T
    Gets the internal Collection of this tag.
    default <T extends net.minecraft.tags.TagKey<?>>
    T
    Gets the TagKey of this tag.
    net.minecraft.resources.ResourceLocation
    id()
    Gets the id of this tag.
    default List<net.minecraft.resources.ResourceLocation>
    Gets the id's of the elements in this tag.
    Gets the ITagManager for this tag.
    default void
    remove(MCTag... tags)
    Removes the given tags from this tag.
    default void
    removeId(net.minecraft.resources.ResourceLocation... elements)
    Removes the elements that correspond to the given ResourceLocation from this tag.
  • Field Details

  • Method Details

    • exists

      default boolean exists()
      Checks if this tag exists.
      Returns:
      true if this tag exists, false otherwise.
    • id

      net.minecraft.resources.ResourceLocation id()
      Gets the id of this tag.
      Returns:
      The id of this tag.
    • addId

      default void addId(net.minecraft.resources.ResourceLocation... elements)
      Adds the elements that correspond to the given ResourceLocation to this tag.
      Parameters:
      elements - The registry key of the elements to add.
      DocParam:
      elements invalid input: '<'resource:minecraft:diamond>
    • add

      default void add(MCTag... tags)
      Adds the given tags to this tag.
      Parameters:
      tags - The tags to add.
      DocParam:
      tags invalid input: '<'tag:item:minecraft:wool>
    • removeId

      default void removeId(net.minecraft.resources.ResourceLocation... elements)
      Removes the elements that correspond to the given ResourceLocation from this tag.
      Parameters:
      elements - The registry key of the elements to remove.
      DocParam:
      elements invalid input: '<'resource:minecraft:diamond>
    • remove

      default void remove(MCTag... tags)
      Removes the given tags from this tag.
      Parameters:
      tags - The tags to remove.
      DocParam:
      tags invalid input: '<'tag:item:minecraft:wool>
    • clear

      default void clear()
      Removes all elements in this tag.
    • contains

      default boolean contains(net.minecraft.resources.ResourceLocation id)
      Checks if this tag contains an element with the given id
      Parameters:
      id - The ID of the element to check.
      Returns:
      true if it contains the element, false otherwise.
      DocParam:
      id invalid input: '<'resource:minecraft:white_wool>
    • idElements

      default List<net.minecraft.resources.ResourceLocation> idElements()
      Gets the id's of the elements in this tag.
      Returns:
      The id's elements in this tag.
    • manager

      ITagManager<?> manager()
      Gets the ITagManager for this tag.
      Returns:
      The ITagManager for this tag.
    • equals

      default boolean equals(MCTag other)
      Checks if this tag equals the other tag.
      Parameters:
      other - The tag to check against.
      Returns:
      true if the tags are equal, false otherwise.
      DocParam:
      other invalid input: '<'tag:item:minecraft:wool>
    • getInternal

      default <T extends Collection<net.minecraft.core.Holder<?>>> T getInternal()
      Gets the internal Collection of this tag.

      This should only be used if the values of the tag is needed, other usecases should use getTagKey() instead.

      Returns:
      The internal Collection of this tag.
    • getTagKey

      default <T extends net.minecraft.tags.TagKey<?>> T getTagKey()
      Gets the TagKey of this tag.
      Returns:
      The TagKey of this tag.
    • compareTo

      default int compareTo(@Nonnull MCTag o)
      Specified by:
      compareTo in interface Comparable<MCTag>
    • getCommandString

      default String getCommandString()
      Description copied from interface: CommandStringDisplayable
      Returns the BEP to get this thingy
      Specified by:
      getCommandString in interface CommandStringDisplayable