net.minecraft.nbt

## Class NBTBase

- java.lang.Object
- - net.minecraft.nbt.NBTBase

- Direct Known Subclasses:
    NBTTagByte, NBTTagByteArray, NBTTagCompound, NBTTagDouble, NBTTagEnd, NBTTagFloat, NBTTagInt, NBTTagIntArray, NBTTagList, NBTTagLong, NBTTagShort, NBTTagString

      public abstract class NBTBase
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String[]` | `NBTTypes`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract NBTBase` | `copy()` Creates a clone of the tag.
    `boolean` | `equals(Object par1Obj)`
    `abstract byte` | `getId()` Gets the type byte for the tag.
    `String` | `getName()` Gets the name corresponding to the tag, or an empty string if none set.
    `static String` | `getTagName(byte par0)` Returns the string name of a tag with the specified type, or 'UNKNOWN' if invalid.
    `int` | `hashCode()`
    `static NBTBase` | `newTag(byte par0, String par1Str)` Creates and returns a new tag of the specified type, or null if invalid.
    `static NBTBase` | `readNamedTag(DataInput par0DataInput)` Reads and returns a tag from the given DataInput, or the End tag if no tag could be read.
    `NBTBase` | `setName(String par1Str)` Sets the name for this tag and returns this for convenience.
    `static void` | `writeNamedTag(NBTBase par0NBTBase, DataOutput par1DataOutput)` Writes the specified tag to the given DataOutput, writing the type byte, the UTF string key and then calling the tag to write its data.

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### NBTTypes

          public static final String[] NBTTypes

  - ### Method Detail

    - #### getId

          public abstract byte getId()

      Gets the type byte for the tag.

    - #### setName

          public NBTBase setName(String par1Str)

      Sets the name for this tag and returns this for convenience.

    - #### getName

          public String getName()

      Gets the name corresponding to the tag, or an empty string if none set.

    - #### readNamedTag

          public static NBTBase readNamedTag(DataInput par0DataInput)
                                      throws IOException

      Reads and returns a tag from the given DataInput, or the End tag if no tag could be read.
      Throws:
        `IOException`

    - #### writeNamedTag

          public static void writeNamedTag(NBTBase par0NBTBase,
                           DataOutput par1DataOutput)
                                    throws IOException

      Writes the specified tag to the given DataOutput, writing the type byte, the UTF string key and then calling the tag to write its data.
      Throws:
        `IOException`

    - #### newTag

          public static NBTBase newTag(byte par0,
                       String par1Str)

      Creates and returns a new tag of the specified type, or null if invalid.

    - #### getTagName

          public static String getTagName(byte par0)

      Returns the string name of a tag with the specified type, or 'UNKNOWN' if invalid.

    - #### copy

          public abstract NBTBase copy()

      Creates a clone of the tag.

    - #### equals

          public boolean equals(Object par1Obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`