read
Read an NBT value from an SNBT (stringified NBT) string.
If you are sure that your data will be an NBTCompound or NBTList, you may use readCompound and readList respectively. Unlike those methods, this one will directly parse and return SNBT literals (e.g. 1b, 12.34F, "Hello World", 450s, etc) and array types.
Return
The parsed NBT value (type will vary)
Parameters
snbt
The text to parse into NBT
Throws
If the input string cannot be read or is not valid SNBT
public static Object read( String snbt, boolean internNames, boolean internValues)
Content copied to clipboard
Same as read, but with additional control over the interning of tag names and values
See also
Parameters
intern Names
Whether or not tag names inside of compounds will be interned
intern Values
Whether or not STRING values inside compounds and lists will be interned