Enum Class NBTTags
- All Implemented Interfaces:
Serializable,Comparable<NBTTags>,Constable
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription8-bit signed integerArray of unsigned bytesNamed collection of heterogeneous tags64-bit floating point numberMarks the end of compound tag contents32-bit floating point number32-bit signed integerArray of 32-bit signed integersOrdered collection of same-type tags64-bit signed integerArray of 64-bit signed integers16-bit signed integerUTF-8 encoded string -
Method Summary
Modifier and TypeMethodDescriptionstatic NBTTagsgetById(int id) Looks up an NBT tag type by its numeric ID.intgetId()Returns the official NBT type ID for this tag type.getName()Returns the official tag type name.static NBTTagsReturns the enum constant of this class with the specified name.static NBTTags[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Tag_End
Marks the end of compound tag contents -
Tag_Byte
8-bit signed integer -
Tag_Short
16-bit signed integer -
Tag_Int
32-bit signed integer -
Tag_Long
64-bit signed integer -
Tag_Float
32-bit floating point number -
Tag_Double
64-bit floating point number -
Tag_Byte_Array
Array of unsigned bytes -
Tag_String
UTF-8 encoded string -
Tag_List
Ordered collection of same-type tags -
Tag_Compound
Named collection of heterogeneous tags -
Tag_Int_Array
Array of 32-bit signed integers -
Tag_Long_Array
Array of 64-bit signed integers
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getById
-
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
Returns the official tag type name.- Returns:
- The tag name as defined in the NBT specification
-