NBT
Index
Classes
Classes
CompoundTag
List tags represent NBT map-like data structure (key-value pairs). it's values may be of any type, so check the type before calling the appropriate getter.
constructor
Creates a new compound tag.
Returns CompoundTag
clear
Removes all the tags from the compound tags.
Returns void
contains
Parameters
key: string
Returns boolean
trueif specified key exists in compound tag.
containsValueOfType
Parameters
key: string
key to verify for the type
type: number
tag type to verify for, one of the ENbtDataType constants
Returns boolean
trueif specified key exists in compound tag and it's value is of specified type.
getAllKeys
Returns Array<string>
Java-array containing all the keys of the compound tag.
getByte
Parameters
key: string
Returns number
NBT tag of byte type by it's key.
getCompoundTag
Parameters
key: string
Returns CompoundTag
NBT tag of compound type by it's key. Note that a copy of existing compound tag is created so you cannot edit it directly. Use setCompoundTag method to apply changes or use getCompoundTagNoClone to edit it directly.
getCompoundTagNoClone
Parameters
key: string
Returns CompoundTag
Directly editable NBT tag of byte type by it's key. Don't save reference for future usage since they get destroyed when the parent object is destroyed.
getDouble
Parameters
key: string
Returns number
NBT tag of double type by it's key.
getFloat
Parameters
key: string
Returns number
NBT tag of float type by it's key.
getInt
Parameters
key: string
Returns number
NBT tag of 32-bit integer type by it's key.
getInt64
Parameters
key: string
Returns number
NBT tag of 64-bit integer type by it's key.
getListTag
Parameters
key: string
Returns ListTag
NBT tag of list type by it's key. Note that a copy of existing list tag is created so you cannot edit it directly. Use setCompoundTag method to apply changes or use getListTagNoClone to edit it directly.
getListTagNoClone
Parameters
key: string
Returns ListTag
Directly editable NBT tag of byte type by it's key. Don't save reference for future usage since they get destroyed when the parent object is destroyed.
getShort
Parameters
key: string
Returns number
NBT tag of short type by it's key.
getString
Parameters
key: string
Returns string
NBT tag of string type by it's key.
getValueType
Parameters
key: string
Returns number
Value type for the specified key. One of the ENbtDataType constants.
putByte
Puts value of byte type into compound tag.
Parameters
key: string
value: number
Returns void
putCompoundTag
Puts value of compound type into compound tag.
Parameters
key: string
value: CompoundTag
Returns void
putDouble
Puts value of double type into compound tag.
Parameters
key: string
value: number
Returns void
putFloat
Puts value of float type into compound tag.
Parameters
key: string
value: number
Returns void
putInt
Puts value of 32-bit integer type into compound tag.
Parameters
key: string
value: number
Returns void
putInt64
Puts value of 64-bit integer type into compound tag.
Parameters
key: string
value: number
Returns void
putListTag
Puts value of list type into compound tag.
Parameters
key: string
value: ListTag
Returns void
putShort
Puts value of short type into compound tag.
Parameters
key: string
value: number
Returns void
putString
Puts value of string type into compound tag.
Parameters
key: string
value: string
Returns void
remove
Removes tag by it's key.
Parameters
key: string
Returns void
toScriptable
Converts compound tag to JavaScript object for easier reading.
Returns Scriptable
Valid JavaScript representation of compound tag.
ListTag
List tags represent NBT array-like indexed data structure. it's values may be of any type, so check the type before calling the appropriate getter.
constructor
Creates a new list tag.
Returns ListTag
clear
Removes all the tags from the compound tags.
Returns void
getByte
Parameters
index: number
Returns number
NBT tag of byte type by it's index.
getCompoundTag
Parameters
index: number
Returns CompoundTag
NBT tag of compound type by it's index. Note that a copy of existing compound tag is created so you cannot edit it directly. Use setCompoundTag method to apply changes or use getCompoundTagNoClone to edit it directly.
getCompoundTagNoClone
Parameters
index: number
Returns CompoundTag
Directly editable NBT tag of byte type by it's index. Don't save reference for future usage since they get destroyed when the parent object is destroyed.
getDouble
Parameters
index: number
Returns number
NBT tag of double type by it's index.
getFloat
Parameters
index: number
Returns number
NBT tag of float type by it's index.
getInt
Parameters
index: number
Returns number
NBT tag of 32-bit integer type by it's index.
getInt64
Parameters
index: number
Returns number
NBT tag of 64-bit integer type by it's index.
getListTag
Parameters
index: number
Returns ListTag
NBT tag of list type by it's index. Note that a copy of existing list tag is created so you cannot edit it directly. Use setCompoundTag method to apply changes or use getListTagNoClone to edit it directly.
getListTagNoClone
Parameters
index: number
Returns ListTag
Directly editable NBT tag of byte type by it's index. Don't save reference for future usage since they get destroyed when the parent object is destroyed.
getShort
Parameters
index: number
Returns number
NBT tag of short type by it's index.
getString
Parameters
index: number
Returns string
NBT tag of string type by it's index.
getValueType
Parameters
index: number
Returns number
Value type for the specified index. One of the ENbtDataType constants.
length
Returns number
Count of the tags in the list tag.
putByte
Puts value of byte type into list tag.
Parameters
index: number
value: number
Returns void
putCompoundTag
Puts value of compound type into list tag.
Parameters
index: number
value: CompoundTag
Returns void
putDouble
Puts value of double type into list tag.
Parameters
index: number
value: number
Returns void
putFloat
Puts value of float type into list tag.
Parameters
index: number
value: number
Returns void
putInt
Puts value of 32-bit integer type into list tag.
Parameters
index: number
value: number
Returns void
putInt64
Puts value of 64-bit integer type into list tag.
Parameters
index: number
value: number
Returns void
putListTag
Puts value of list type into list tag.
Parameters
index: number
value: ListTag
Returns void
putShort
Puts value of short type into list tag.
Parameters
index: number
value: number
Returns void
putString
Puts value of string type into list tag.
Parameters
index: number
value: string
Returns void
toScriptable
- since: 2.0.5b45
Converts list tag to JavaScript object for easier reading.
Returns any[]
Valid JavaScript representation of list tag.
NBT (Named Binary Tag) is a tag based binary format designed to carry large amounts of binary data with smaller amounts of additional data. You can get or set nbt tags of entities, native tile entities (such as chests or beacons) and items. To get more information about these data structures, see page.