- All Superinterfaces:
TagReadable
,TagWritable
Represents an element which can read and write
tags
.-
Method Summary
Modifier and TypeMethodDescriptionnet.kyori.adventure.nbt.CompoundBinaryTag
Converts the content of this handler into aCompoundBinaryTag
.copy()
Creates a copy of this handler.static TagHandler
fromCompound
(net.kyori.adventure.nbt.CompoundBinaryTag compound) Copy the content of the givenCompoundBinaryTag
into a newTagHandler
.static TagHandler
Creates a readable copy of this handler.void
updateContent
(net.kyori.adventure.nbt.CompoundBinaryTag compound) Updates the content of this handler.Methods inherited from interface net.minestom.server.tag.TagReadable
getTag, hasTag
Methods inherited from interface net.minestom.server.tag.TagWritable
getAndSetTag, getAndUpdateTag, removeTag, setTag, updateAndGetTag, updateTag
-
Method Details
-
readableCopy
TagReadable readableCopy()Creates a readable copy of this handler.Similar to
asCompound()
with the advantage that cached objects and adaptive optimizations may be reused.- Returns:
- a copy of this handler
-
copy
TagHandler copy()Creates a copy of this handler.Similar to
fromCompound(CompoundBinaryTag)
usingasCompound()
with the advantage that cached objects and adaptive optimizations may be reused.- Returns:
- a copy of this handler
-
updateContent
void updateContent(net.kyori.adventure.nbt.CompoundBinaryTag compound) Updates the content of this handler.Can be used as a clearing method with
CompoundBinaryTag.empty()
.- Parameters:
compound
- the new content of this handler
-
asCompound
net.kyori.adventure.nbt.CompoundBinaryTag asCompound()Converts the content of this handler into aCompoundBinaryTag
.- Returns:
- a nbt compound representation of this handler
-
newHandler
-
fromCompound
Copy the content of the givenCompoundBinaryTag
into a newTagHandler
.- Parameters:
compound
- the compound to read tags from- Returns:
- a new tag handler with the content of the given compound
-