Class Tag
java.lang.Object
net.minestom.server.gamedata.tags.Tag
- All Implemented Interfaces:
net.kyori.adventure.key.Keyed
,ProtocolObject
Represents a group of items, blocks, fluids, entity types or function.
Immutable by design
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionTag
(@NotNull NamespaceID name) Creates a new empty tag.Tag
(@NotNull NamespaceID name, @NotNull Set<NamespaceID> values) Creates a new tag with the given values. -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(@NotNull NamespaceID id) Checks whether the given id in inside this tag.getName()
Deprecated.@NotNull Set
<NamespaceID> Returns an immutable set of values present in this tag@NotNull net.kyori.adventure.key.Key
key()
@NotNull String
name()
@NotNull NamespaceID
toString()
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
Creates a new empty tag. This does not cache the tag. -
Tag
Creates a new tag with the given values. This does not cache the tag.
-
-
Method Details
-
contains
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
Returns an immutable set of values present in this tag- Returns:
- immutable set of values present in this tag
-
namespace
-
name
-
key
@Contract(pure=true) @NotNull public @NotNull net.kyori.adventure.key.Key key()- Specified by:
key
in interfacenet.kyori.adventure.key.Keyed
-
getName
Deprecated.Returns the name of this tag -
toString
-