NBT-data/Entities

This article is incomplete.

The NBT data format is used to save gameplay for entities, players, and tile entities. This page documents the tags LOTR mod uses and adds for entities and summarizes the vanilla tags for entities. The basic idea behind the NBT format and how the LOTR mod uses it can be found here. This page uses the same data-type abbreviations and formats as the mentioned page. The example tags can be used in the  and the   commands.

Entity data (vanilla)

 * [str] id: Entity ID. For LOTR entities, the id needs the "lotr." prefix.


 * [list] Pos: 3 Doubles describing the current X,Y,Z position of the entity.
 * [d] x; [d] y; [d] z


 * [list] Motion: 3 Doubles describing the current dX,dY,dZ velocity of the entity in meters per tick.
 * [d] x; [d] y; [d] z


 * [list] Rotation: Two Floats representing viewing direction in degrees.


 * [fl] The entity's rotation clockwise around the Y axis (called yaw). Due west is 0. Does not exceed 360 degrees. The StoneTroll entity uses this rotation value but not the other one.


 * [fl] The entity's declination from the horizon (called pitch). Horizontal is 0. Positive values look downward. Does not exceed positive or negative 90 degrees.
 * [fl] FallDistance: Distance the entity has fallen. Larger values cause more damage when the entity lands.


 * [sh] Fire: Number of ticks until the fire is put out. Negative values reflect how long the entity can stand in fire before burning. Default -1 when not on fire.


 * [sh] Air: How much air the entity has, in ticks. Fills to a maximum of 300 in air, giving 15 seconds submerged before the entity starts to drown, and a total of up to 35 seconds before the entity dies (if it has 20 health). Decreases while underwater. If 0 while underwater, the entity loses 1 health per second.


 * [b] OnGround: 1 or 0 (true/false) - true if the entity is touching the ground.


 * [int] Dimension: -1 for The Nether, 0 for The Overworld, 1 for The End, and 100 for Middle Earth.


 * [b] Invulnerable: 1 or 0 (true/false) - true if the entity should not take damage. Mobs will not take damage from any source (including potion effects) and cannot be moved by fishing rods, attacks, explosions, or projectiles, and objects such as vehicles, and wall banners cannot be destroyed unless their supports are removed.


 * [int] PortalCooldown: The number of ticks before which the entity may be teleported back through a portal of any kind. Initially starts at 900 ticks (45 seconds) after teleportation and counts down to 0.


 * [l] UUIDMost: The most significant bits of this entity's Universally Unique IDentifier. This is joined with UUIDLeast to form this entity's unique ID.


 * [l] UUIDLeast: The least significant bits of this entity's Universally Unique IDentifier.


 * [l] UUID: The Universally Unique IDentifier of this entity. Converts a hexadecimal UUID (for example: 069a79f4-44e9-4726-a5be-fca90e38aaf5) into the UUIDLeast and UUIDMost tags. Will not apply new UUIDLeast and UUIDMost tags if both of these tags are already present. The "UUID" tag is removed once the entity is loaded.


 * [str] CustomName: The custom name of this entity. Appears in player death messages and villager trading interfaces, as well as above the entity when your cursor is over it. May not exist, or may exist and be empty. Note that LOTR-NPCs have their own CustomName-tag, that overrides the vanilla CustomName.


 * [str] CustomNameVisible: 1 or 0 (true/false) - if true, and this entity has a custom name (or is an LOTR-NPC with an NPC name), it will always appear above them, whether or not the cursor is pointing at it. May not exist.


 * {} Riding: The data of the entity being ridden. Note that if an entity is being ridden, the topmost entity in the stack has the Pos tag, and the coordinates specify the location of the bottommost entity. Also, note that the bottommost entity controls movement, while the topmost entity determines spawning conditions when created by a mob spawner.

New tags from the LOTR-mod
The Ring Portal (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) - Default true. Is set to false as soon as the NPC gets damage from anything other than thrown plates. This tag is used to determine if a player can get the achievement "Kitchen Brawler".


 * [b] NPCPassive: 1 or 0 (true/false) - When set to true, the Mob won't attack enemies 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 such as the Hobbit Tavern). The tag is used for certain speech lines.


 * [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).
 * [int] NPCDrunkTime: The number of ticks that an NPC will remain drunk.
 * [int] NPCDrunkTime: The number of ticks that an NPC will remain drunk.


 * {} HiredNPCInfo: 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 too 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 enemies this unit already killed in its 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] Squadron: The squadron this unit is part of.


 * [str] HiringPlayerUUID: The unique player ID, that "owns" this unit. The UUID is a code that determines each player. (Example: cf4519e2-1d45-4762-bc38-605de9ed5a07)


 * [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.

Any NPC with an inventory has a different system of determining Armour, Idle Items, Replaced Items, and more, which can be found here.

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


 * [str] NPCName: 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", he is shown in the game as "Kili, the Dwarf" or "Kili, the Dwarven Warrior" (depending on his mob type).


 * [b] NPCMale: 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.
 * [int] NPCAge: This tag determines the NPC's age.
 * [int] NPCAge: This tag determines the NPC's age.

All item traders also have these additional tags:


 * {} LOTRBuyTrades: Contains a list of all available 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.

All types of wargs have this additional tag:


 * [b] WargType: 0-6, determines the type/color of the warg. Values 4-6 are used for the special Utumno wargs.