NBT-data

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 check 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 and entitys 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.

Usage in the Game
NBT-tags can be used in some commands to specify a item, mob, block or player. When a command accepts NBT-tags as argument, the argument must be in curly brackets.

example: /setblock ~ ~-1 ~ lotr:tile.lotr:hobbitOven 0 destroy {Items:[{Count:64,Slot:10,id:364}]}


 * This command will set a hobbit Oven below the command source (player) that will contain a stack of cooked steaks in the second "cooked"-slot. The items contained in the oven are written in the NBT-format.

New tags from the LOTR-mod
The Ringportal (lotr.Portal) has this additional tag:


 * [int] Scale: When a Portal has been created, the ring starts small and grows until full size. This value determines, how far the ring already has grown. The maximum is 120.

All NPCs have these additional fields


 * [b] HurtOnlyByPlates: 1 or 0 (true/false). Unknown use.


 * [b] NPCPassive: 1 or 0 (true/false) - When set o true, the Mob won't attack enemys on sight (if you would otherwise).


 * [b] NPCPersistent: 1 or 0 (true/false) - whether the Mob is bound to a structure and thus won't despawn. Equivalent to vanilla "PersistenceRequired"


 * [b] RidingHorse: 1 or 0 (true/false) - whether the Mob is riding a horse (not any other mount). Unknown effect.


 * [b] SpecificLocationName: 1 or 0 (true/false) - whether the Mob is bound to a structure.


 * [str] NPCLocationName: Name of the structure, the Mob is bound to (Does only exist for named structures like the Hobbit Tavern)


 * [int] NPCHomeX; [int] NPCHomeY; [int] NPCHomeZ: Coordinates of the center of the structure, the Mob is bound to (only if it has a home). Is also used to determine the location to be guarded/farmed for recruited units in guard mode.


 * [int] NPCHomeRadius: Range to the structure center, in that the Mob is free to move while bound to a structure. Is also used to determine the guarding/farming range for hired units in guard mode. Set to -1 when the Mob is free to wander around (or has to follow his commander).


 * {} HiredPlayerInfo: This tag stores information about who is commanding the unit and which commands the unit have.


 * [b] CanMove: 1 or 0 (true/false) - when set to 0, the Mob won't be able to move unless being attacked. This tag only affects hired Mobs (IsActive:1)


 * [b] GuardMode: 1 or 0 (true/false) - whether the Mob has been commanded to guard a specific location instead of following the player.


 * [b] IsActive: 1 or 0 (true/false) - whether the Mob has been hired. When set to 0, all other HiredPlayerInfo-tags will have no effect


 * [b] ObeyHornHaltReady: 1 or 0 (true/false) - if set to 0, the Mob won't react to the Horn of Halt Units.


 * [b] ObeyHornSummon: 1 or 0 (true/false) - if set to 0, the Mob won't react to the Horn of Summon Units.


 * [b] TeleportAutomatically: 1 or 0 (true/false) - whether the Mob summons automatically to the commanding player, when he moves to far away (like tamed wolves).


 * [int] AlignmentRequired: The alignment required to have this Unit recruited. When the commanding player's alignment with the Mob's faction gets under this value, the Unit will desert.


 * [int] GuardRange: The range, that a unit may move away from the guarding center. While the unit is in GuardMode, this value will also get stored in "NPCHomeRadius". This tag is also used for the farming range of hireable farming units.


 * [int] MobKills: A statistic, how many enemys this unit already killed in it's life. Has currently no effect on the game but is shown in the commanding screen.


 * [int] Task: Indicator, which special task the unit was given. Currently the only special task, a unit can have is farming (Task:1).


 * [str] HiringPlayerName: The player name, that "owns" this unit.


 * [list] HiredInventory: The Inventory of a hired farming unit. It contains three slots (numbered 0-2), where the first one is the seeds slot and the later ones are the harvest slots.


 * {}: This is one inventory slot.

Depending on their race, NPCs can also have these additional tags:


 * [str] GondorName/RohirrimName/DwarfName/HaradrimName/HobbitName/OrcName/DunlendingName/TrollName/EntName/... : This is the name that is randomly generated for each NPC when he spawns. This name is mostly used when talking to the NPC. When a Dwarf-NPC has for example the name "Kili" then he is shown in the game as "Kili, the Dwarf" or "Kili, the Dwarven Warrior" (depending on his mob type).


 * [b] HaradrimGender/HobbitGender/DwarfGender/ElfGender... :This tag only exists for races that have both genders (so for example not for Gondor) though in the future probably nearly all factions will get women. 1 means man and 0 means woman.

All item traders also have these additional tags:


 * {} LOTRBuyTrades: Contains a list of all avaiable item variants that the player can buy from the NPC.


 * [list]


 * {} One individual trade written in the Item format plus the Cost tag.


 * [int] Cost: The price (in silver coins) paid by the player for the determined items and the determined amount.


 * {} LOTRSellTrades: Contains a list of all avaiable item variants that the player can sell to the NPC.


 * [list]


 * {} One individual trade written in the Item format plus the Cost tag.


 * [int] Cost: The price (in silver coins) that the player gets when he sells the determined items in the determined amount.

Trolls (and StoneTrolls) have this additional tag:


 * [b] TrollOutfit: 0-2, determines the type of clothing the troll wears.