Interface Tag

All Known Subinterfaces:
NumberArrayTag, NumberTag
All Known Implementing Classes:
ByteArrayTag, ByteTag, CompoundTag, DoubleTag, FloatTag, IntArrayTag, IntTag, ListTag, LongArrayTag, LongTag, MixedListTag, ShortTag, StringTag

public interface Tag
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the raw string representation of the value of this tag.
    Returns a copy of this tag.
    int
    Returns the NBT tag id of this tag type, used in I/O.
    Returns the value of this tag.
    void
    Writes this tag to an output stream.
  • Method Details

    • getValue

      Object getValue()
      Returns the value of this tag.
      Returns:
      value of this tag
    • asRawString

      String asRawString()
      Returns the raw string representation of the value of this tag. For SNBT, use SNBT.serialize(Tag).
      Returns:
      raw string representation of the value of this tag
    • write

      void write(DataOutput out) throws IOException
      Writes this tag to an output stream.
      Parameters:
      out - data output to write to
      Throws:
      IOException - if an I/O error occurs
    • getTagId

      int getTagId()
      Returns the NBT tag id of this tag type, used in I/O.
      Returns:
      ID of the tag this class represents
    • copy

      Tag copy()
      Returns a copy of this tag.
      Returns:
      a copy of this tag