java.lang.Object
net.minestom.server.gamedata.tags.Tag
All Implemented Interfaces:
net.kyori.adventure.key.Keyed, ProtocolObject

public final class Tag extends Object implements ProtocolObject, net.kyori.adventure.key.Keyed
Represents a group of items, blocks, fluids, entity types or function. Immutable by design
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Tag(@NotNull net.kyori.adventure.key.Key name)
    Creates a new empty tag.
    Tag(@NotNull net.kyori.adventure.key.Key name, @NotNull Set<net.kyori.adventure.key.Key> values)
    Creates a new tag with the given values.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(@NotNull net.kyori.adventure.key.Key id)
    Checks whether the given id in inside this tag.
    net.kyori.adventure.key.Key
    Deprecated.
    @NotNull Set<net.kyori.adventure.key.Key>
    Returns an immutable set of values present in this tag
    @NotNull net.kyori.adventure.key.Key
    key()
     
    @NotNull String
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.minestom.server.registry.ProtocolObject

    registry
  • Constructor Details

    • Tag

      public Tag(@NotNull @NotNull net.kyori.adventure.key.Key name)
      Creates a new empty tag. This does not cache the tag.
    • Tag

      public Tag(@NotNull @NotNull net.kyori.adventure.key.Key name, @NotNull @NotNull Set<net.kyori.adventure.key.Key> values)
      Creates a new tag with the given values. This does not cache the tag.
  • Method Details

    • contains

      public boolean contains(@NotNull @NotNull net.kyori.adventure.key.Key id)
      Checks whether the given id in inside this tag.
      Parameters:
      id - the id to check against
      Returns:
      'true' iif this tag contains the given id
    • getValues

      @NotNull public @NotNull Set<net.kyori.adventure.key.Key> getValues()
      Returns an immutable set of values present in this tag
      Returns:
      immutable set of values present in this tag
    • name

      @Contract(pure=true) @NotNull public @NotNull String name()
    • key

      @Contract(pure=true) @NotNull public @NotNull net.kyori.adventure.key.Key key()
      Specified by:
      key in interface net.kyori.adventure.key.Keyed
    • getName

      @Deprecated public net.kyori.adventure.key.Key getName()
      Deprecated.
      Returns the name of this tag
    • toString

      public String toString()
      Overrides:
      toString in class Object