Enum Class NBTTags

java.lang.Object
java.lang.Enum<NBTTags>
de.pauleff.util.NBTTags
All Implemented Interfaces:
Serializable, Comparable<NBTTags>, Constable

public enum NBTTags extends Enum<NBTTags>
NBT tag type registry containing all 13 official tag types from the NBT specification. Each enum represents a specific data type with its official ID and name as defined by Minecraft. This enum serves as the authoritative mapping between numeric tag IDs and their corresponding types.
Author:
Paul Ferlitz
See Also:
  • Enum Constant Details

    • Tag_End

      public static final NBTTags Tag_End
      Marks the end of compound tag contents
    • Tag_Byte

      public static final NBTTags Tag_Byte
      8-bit signed integer
    • Tag_Short

      public static final NBTTags Tag_Short
      16-bit signed integer
    • Tag_Int

      public static final NBTTags Tag_Int
      32-bit signed integer
    • Tag_Long

      public static final NBTTags Tag_Long
      64-bit signed integer
    • Tag_Float

      public static final NBTTags Tag_Float
      32-bit floating point number
    • Tag_Double

      public static final NBTTags Tag_Double
      64-bit floating point number
    • Tag_Byte_Array

      public static final NBTTags Tag_Byte_Array
      Array of unsigned bytes
    • Tag_String

      public static final NBTTags Tag_String
      UTF-8 encoded string
    • Tag_List

      public static final NBTTags Tag_List
      Ordered collection of same-type tags
    • Tag_Compound

      public static final NBTTags Tag_Compound
      Named collection of heterogeneous tags
    • Tag_Int_Array

      public static final NBTTags Tag_Int_Array
      Array of 32-bit signed integers
    • Tag_Long_Array

      public static final NBTTags Tag_Long_Array
      Array of 64-bit signed integers
  • Method Details

    • values

      public static NBTTags[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static NBTTags valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getById

      public static NBTTags getById(int id)
      Looks up an NBT tag type by its numeric ID. Performs fast array-based lookup for efficient tag type resolution.
      Parameters:
      id - The NBT type ID to find (0-12)
      Returns:
      The corresponding NBTTags enum, or null if ID is invalid
    • getId

      public int getId()
      Returns the official NBT type ID for this tag type.
      Returns:
      The numeric ID as defined in the NBT specification
    • getName

      public String getName()
      Returns the official tag type name.
      Returns:
      The tag name as defined in the NBT specification