The NBT-format ("Named Binary Tags") is used in almost all minecraft save formats. This pages collects documentation for NBT-format changes and NBT-tags added by the LOTR-mod. For documentation to the vanilla NBT-tags see the official minecraft wiki.
Introduction to the NBT-format[]
The NBT-format is used to store minecraft worlds and with this to store all blocks, entities, and the player itself. "Named Binary" means that NBT-tags consist of two things: a name and a value that belongs to the name. In addition, a NBT-tag has a data-type following the java data-type that will be used to save this value. Each data-type has a specific range the value must be in. For a full list of data types with descriptions, view the minecraft wiki page linked above.
Data Type | Short form (as used on this page) | Range / Validity |
---|---|---|
Byte | [b] | Valid values are between -128 and 127, inclusive. This may not be a decimal number. |
Boolean * | [bool] | Identical to the Byte data type, except the only valid values are 1 and 0. The text true may be substituted for the 1, and false may be used instead of 0. |
Short | [sh] | Valid values are between -32768 and 32767, inclusive. This may not be a decimal number. |
Int | [int] | Valid values are between -231 and 231-1, inclusive. This may not be a decimal number. |
Long | [l] | Valid values are between -263 and 263-1, inclusive. This may not be a decimal number. |
Float | [fl] | Valid finite values are between (2-2-23)·2127 and the negative of that number, inclusive. This may be a decimal number. |
Double | [d] | Valid finite values are between (2-2-52)·21023 and the negative of that number, inclusive. This may be a decimal number. |
String | [str] | This is literal text, which must be surrounded by double quotes. It may contain escape sequences to indicate certain characters. May contain no characters. |
List | [list] | An array of tags of the same data type. The index of a child tag serves to identify that tag in the list. May have a zero length. |
Compound | {} | A collection of tags of potentially differing type. A short piece of text followed by a colon serves to identify child tags within the collection. May have a zero size. |
* This data type is included here for convenience. Minecraft does not distinguish between the Byte and the Boolean types in NBT tags.
Usage in the Game[]
NBT-tags can be used in some commands to specify a item, mob, block or player. Further information on that can be found here for entities (and here for NPC inventory), here for blocks and tileentities, and here for items. When a command accepts NBT-tags as argument, the argument must be in curly brackets:
/setblock ~ ~-1 ~ lotr:tile.hobbitOven 0 destroy {Items:[{Count:64,Slot:10,id:364}]}
- This command will set a hobbit Oven below the command source (the player or command block that ran the command) containing a stack of cooked steak in the second "cooked"-slot. The items contained in the oven are written in the itemstack format.