Interface ITag<T>
- Type Parameters:
T- TheObjecttype this tag stores
- All Known Subinterfaces:
ICompoundTag,IListTag
- All Known Implementing Classes:
Basic_Tag,Collection_Tag,Tag,Tag_Byte,Tag_Byte_Array,Tag_Compound,Tag_Double,Tag_End,Tag_Float,Tag_Int,Tag_Int_Array,Tag_List,Tag_Long,Tag_Long_Array,Tag_Short,Tag_String
public interface ITag<T>
Base interface for all NBT (Named Binary Tag) structures.
NBT tags are the fundamental building blocks of Minecraft's data format,
each carrying a name, type, and payload according to the NBT specification.
- Author:
- Paul Ferlitz
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidapplyOperation(Consumer<ITag<T>> operation) Applies a custom transformation or inspection operation to this tag.voidReplaces this tag's content with data from another compatible tag.getData()Returns the actual data payload stored in this tag.intgetId()Returns the NBT type identifier for this tag.getName()Returns the name of this tag.voidUpdates the data payload of this tag.voidUpdates the name of this tag.toString()Returns a human-readable representation of this tag.
-
Method Details
-
getId
int getId()Returns the NBT type identifier for this tag. Each tag type has a unique ID as defined in the NBT specification.- Returns:
- The NBT type ID (0-12)
-
getName
-
setName
-
getData
-
setData
-
editTag
Replaces this tag's content with data from another compatible tag. Both tags must be of the same NBT type.- Parameters:
newTag- The source tag to copy from
-
applyOperation
-
toString
-