Class Tag
java.lang.Object
net.minestom.server.gamedata.tags.Tag
- All Implemented Interfaces:
net.kyori.adventure.key.Keyed,net.minestom.server.registry.ProtocolObject
public final class Tag
extends Object
implements net.minestom.server.registry.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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(@NotNull net.minestom.server.utils.NamespaceID id) Checks whether the given id in inside this tag.net.minestom.server.utils.NamespaceIDgetName()Deprecated.@NotNull Set<net.minestom.server.utils.NamespaceID> Returns an immutable set of values present in this tag@NotNull net.kyori.adventure.key.Keykey()@NotNull Stringname()@NotNull net.minestom.server.utils.NamespaceIDMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minestom.server.registry.ProtocolObject
registry
-
Constructor Details
-
Tag
public Tag(@NotNull @NotNull net.minestom.server.utils.NamespaceID name) Creates a new empty tag. This does not cache the tag. -
Tag
public Tag(@NotNull @NotNull net.minestom.server.utils.NamespaceID name, @NotNull @NotNull Set<net.minestom.server.utils.NamespaceID> values) Creates a new tag with the given values. This does not cache the tag.
-
-
Method Details
-
contains
public boolean contains(@NotNull @NotNull net.minestom.server.utils.NamespaceID 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
Returns an immutable set of values present in this tag- Returns:
- immutable set of values present in this tag
-
namespace
@NotNull public @NotNull net.minestom.server.utils.NamespaceID namespace() -
name
-
key
@Contract(pure=true) @NotNull public @NotNull net.kyori.adventure.key.Key key()- Specified by:
keyin interfacenet.kyori.adventure.key.Keyed
-
getName
Deprecated.Returns the name of this tag
-