Minecraft Wiki
Advertisement

Information icon
This feature is exclusive to Java Edition. 

<player>.dat files are used by servers to store the state of individual players. The format is also used within level.dat files to store the state of the singleplayer player, which overrides any <player>.dat files with the same name as the singleplayer player. These files are in NBT format.

NBT structure[]

  • The root tag. In level.dat files, this tag is called "Player".
    • Tags for all entities, except the id, CustomName and CustomNameVisible
    • Tags common to all entities
    • Tags for all mobs, except HandItems, ArmorItems, HandDropChances, ArmorDropChances, CanPickUpLoot, PersistenceRequired and Leash
    • Tags common to all mobs
    •  abilities: The abilities this player has.
      •  flying: 1 or 0 (true/false) - true if the player is currently flying.
      •  flySpeed: The flying speed, always 0.05.
      •  instabuild: 1 or 0 (true/false) - true if the player can instantly destroy blocks. This is true for Creative mode, and false for other game modes.
      •  invulnerable: 1 or 0 (true/false) - true if the player is immune to all damage and harmful effects except for void damage (damage caused by the /kill command is void damage). This also makes all mobs, whether hostile or not, passive to the player. This is true for Creative and Spectator modes, and false for Survival and Adventure modes.
      •  mayBuild: 1 or 0 (true/false) - true if the player can place and destroy blocks. This is true for Creative and Survival modes, and false for Spectator and Adventure modes.
      •  mayfly: 1 or 0 (true/false) - true if the player can fly. This is true for Creative and Spectator modes, and false for Survival and Adventure modes.
      •  walkSpeed: The walking speed, always 0.1.
    •  DataVersion: Version of the player NBT structure. Is increased with every new snapshot and release.
    •  Dimension: The ID of the dimension the player is in. Used to store the players last known location along with Pos.
    •  EnderItems: Each compound tag in this list is an item in the player's 27-slot ender chest inventory. (Note: when empty, list type may have unexpected value.)
      • An item in the inventory, includes the Slot tag - slots are numbered 0 to 26, inclusive.
    •  enteredNetherPosition: Optional. The Overworld position from which the player entered the Nether, for use with the minecraft:nether_travel advancement trigger. The tag is set every time the player passes through a portal from the Overworld to the Nether. When entering a dimension other than the nether by not respawning, the tag is removed. Entering the Nether without using a portal does not update the tag.
      •  x: The X coordinate.
      •  y: The Y coordinate.
      •  z: The Z coordinate.
    •  foodExhaustionLevel: See Hunger.
    •  foodLevel: The value of the hunger bar; 20 is full. See Hunger.
    •  foodSaturationLevel: See Hunger.
    •  foodTickTimer: See Hunger.
    •  Inventory: Each compound tag in this list is an item in the player's inventory. (Note: when empty, list type may have unexpected value.)
    •  LastDeathLocation: May not exist. Location of the player's last death.
      •  dimension: Dimension of last death.
      •  pos: Coordinates of last death.
    •  playerGameType: The game mode of the player. 0 is Survival, 1 is Creative, 2 is Adventure and 3 is Spectator.
    •  previousPlayerGameType: The previous game mode of the player.
    •  recipeBook: Contains a JSON object detailing recipes the player has unlocked.
    •  RootVehicle: The root entity that the player is riding. Optional.
      •  Attach: The UUID of the entity the player is riding, stored as four ints.
      •  Entity: The NBT data of the root vehicle.
    •  Score: The Score displayed upon death.
    •  seenCredits: 1 or 0 (true/false) - true if the player has entered the exit portal in the End at least once.
    •  SelectedItem: Data of the item currently being held by the player, excluding the Slot tag. Only exists when using the /data command, this value is not saved in the player.dat format.
    •  SelectedItemSlot: The selected hotbar slot of the player.
    •  ShoulderEntityLeft: The entity that is on the player's left shoulder. Always displays as a parrot.
    •  ShoulderEntityRight: The entity that is on the player's right shoulder. Always displays as a parrot.
    •  SleepTimer: The number of ticks the player had been in bed. 0 when the player is not sleeping. In bed, increases up to 100, then stops. Skips the night after all players in bed have reached 100. When getting out of bed, instantly changes to 100 and then increases for another 9 ticks (up to 109) before returning to 0.
    •  SpawnDimension: May not exist. The dimension of the player's bed or respawn anchor. These tags are only removed if the player attempts to respawn with no valid bed or respawn anchor to spawn at at these coordinates. They are unaffected by breaking a bed or respawn anchor at these coordinates, and are unaffected by the player's death.
    •  SpawnForced: 1 or 0 (true/false) - may not exist. True if the player should spawn at the below coordinates even if no bed can be found.
    •  SpawnX: See below.
    •  SpawnY: May not exist. The coordinates of the player's bed or respawn anchor. These tags are only removed if the player attempts to respawn with no valid bed or respawn anchor to spawn at at these coordinates. They are unaffected by breaking a bed or respawn anchor at these coordinates, and are unaffected by the player's death.
    •  SpawnZ: See above.
    •  warden_spawn_tracker: Contains data about the warden spawning process for this player.
      •  cooldown_ticks: The number of ticks before the warning_level can be increased again. Decreases by 1 every tick. It is set to 200 game ticks (10 seconds) every time the warning level is increased.
      •  ticks_since_last_warning: The number of ticks since the player was warned for warden spawning. Increases by 1 every tick. After 12000 game ticks (10 minutes) it will be set back to 0, and the warning_level will be decreased by 1.
      •  warning_level: A warning level between 0 and 3 (inclusive). The warden will spawn at level 3.
    •  XpLevel: The level shown on the XP bar.
    •  XpP: The progress/percent across the XP bar to the next level.
    •  XpSeed: The seed used for the next enchantment in enchantment tables.
    •  XpTotal: The total amount of XP the player has collected over time; used for the Score upon death.

Item structure[]

Items are used both in the player's inventory and Ender inventory, and in chest tile entities, dropped item entities, furnace tile entities, brewing stand tile entities, and Villager trading recipes. Sometimes a Slot tag is used to specify the slot the item is in, such as with chests; other times there is no Slot tag, such as with dropped items.

  • The root tag.
    •  Count: Number of items stacked in this inventory slot. Any item can be stacked, even if unstackable through normal means. Values below 0 cause the item to be treated as air, resulting in the item being removed.
    •  Slot: The inventory slot the item is in.
    •  id: Item/Block ID. If not specified, gets treated as air, resulting in the item being removed.
    •  tag: Additional information about the item, discussed more in the subsections of the item structure section. This tag is optional for most items. Unlike other entity or block NBT, this tag is never deserialized and can hold user defined tags that are not used by the game by standard.

General Tags[]

Items with durability can be made unbreakable and never lose any durability. Additionally, items can have specifications for Adventure mode to describe which blocks may be broken with them.

  •  tag: Parent tag.
    •  Damage: The number of uses consumed (not remaining) of the item's durability.
    •  Unbreakable: 1 or 0 (true/false) - if true, the item doesn't lose durability when used.
    •  CanDestroy: The only blocks this item may break when used by a player in adventure mode.
      • : A block ID. Validated the same way as the block_predicate command argument, meaning block states and block tags are accepted, as well as client-side only block entity NBT tags.
    •  CustomModelData: A value used in the "custom_model_data" item tag in the overrides of item models.

Attribute Modifiers[]

All items can be given Modifiers which affect various Attributes of the player or mob wearing or holding them. Note that if an item has default attribute modifiers, these cease to exist if this tag is added (e.g. a diamond sword given an empty AttributeModifiers list no longer provides a boost to damage). Also note that default attribute modifiers do not use this tag, and as such, it does not appear on a natural item.

  •  tag: Parent tag.
    •  AttributeModifiers: Contains Attribute Modifiers on this item which modify Attributes of the wearer or holder (if the item is not in the hand or armor slots, it has no effect).
      • : A single Attribute Modifier.
        •  AttributeName: The name of the Attribute this Modifier is to act upon.
        •  Name: The name of the Modifier. Has no known effect.
        •  Slot: Slot the item must be in for the modifier to take effect. "mainhand", "offhand", "feet", "legs", "chest", or "head".
        •  Operation: Modifier Operation. See Attribute Modifiers for info.
        •  Amount: Amount of change from the modifier.
        •  UUID: The modifier's UUID, stored as four ints. Used when equipping and unequipping the item to identify which modifier to add or remove from the entity.

Block Tags[]

Blocks can be given tags to specify what blocks they may be placed against in Adventure mode, and to specify what Tile Entity NBT tags to apply to them when placed.

  •  tag: Parent tag
    •  CanPlaceOn: Determines which blocks that blocks with this tag can be placed against in adventure mode.
      • : A block ID. Validated the same way as the block_predicate command argument, meaning block states and block tags are accepted, as well as client-side only block entity NBT tags.
    •  BlockEntityTag: Block entity NBT tags which are applied when this block is placed.[1] Used to store data on banners and shields or on blocks obtained in creative by holding ctrl (or ⌘ Cmd on mac) and pressing pick block on a block containing a block entity.
    •  BlockStateTag: A compound where each key is a block state key, and the value is the block state value to force place for this block.
      •  Block state key: The block state value of the block to edit, for example, facing: "east".

Display Properties[]

Leather armor can be colored, and all items can have custom display names and lore. Various tooltips can also be hidden.

  •  tag: Parent tag.
    •  display: Display properties.
      •  color: The color of the leather armor. The tooltip displays "Dyed" if advanced tooltips are disabled, otherwise it displays the hexadecimal color value. Color codes are the hex code of the color converted to a decimal number, or can be calculated from the Red, Green and Blue components using this formula:
        Red<<16 + Green<<8 + Blue[2]
      •  Name: The JSON text component to use to display the item.
      •  Lore: List of strings to display as lore for the item.
        • A JSON text component representing a line of text for the lore of an item.
    •  HideFlags: Bit field determining which parts of the tooltip to hide on an item. 1 for "Enchantments", 2 for "AttributeModifiers", 4 for "Unbreakable", 8 for "CanDestroy", 16 for "CanPlaceOn", 32 for various other information (including potion effects, "StoredEnchantments", written book "generation" and "author", "Explosion", "Fireworks", amount of items in a bundle, and map tooltips), 64 for "Dyed" on leather armor, and 127 for armor trim information. For example, setting to 3 (1 + 2) would hide both "Enchantments" (1) and "AttributeModifiers" (2) tags, and setting to 127‌[until JE 1.20]/255‌[upcoming: JE 1.20] would hide everything.

Enchantments[]

There are two ways enchantments are associated with items; the first way is that the item is actually enchanted and the enchantment affects the behavior of the item, and the second way is that the item is an enchanted book which simply stores the enchantments without actually affecting the behavior of the item. There is also the RepairCost tag which tracks anvil usage for items, making them more costly with every use of the anvil.

  •  tag: Parent tag.
    •  Enchantments: Contains enchantments on this item that affect the way the item works.
      • : A single enchantment.
        •  id: The name of the enchantment.
        •  lvl: The level of the enchantment, where 1 is level 1. Values are clamped between 0 and 255 when reading.
    •  StoredEnchantments: Contains enchantments for enchanted books.
      • : A stored enchantment, identical structure to each enchantment in Enchantments.
    •  RepairCost: Number of experience levels to add to the base level cost when repairing, combining, or renaming this item with an Anvil.

StoredEnchantments tooltips are not displayed if edited onto an item other than an enchanted book. Enchantments stored in Enchantments, however, are always displayed in the tooltip and cause the item to glow, even if they cannot have any effect.

Potion Effects[]

Potions, splash potions, lingering potions, and tipped arrows can have multiple, customized effects via the CustomPotionEffects tag. These effects are added to the default effect under the Potion tag if present. In addition the color can be overridden with the CustomPotionColor tag.

  •  tag: Parent tag.
    •  custom_potion_effects: The custom potion effects (status effects) this potion or tipped arrow has.
      • One of these for each effect.
        •  id: The resource location of the effect.
        •  amplifier: The amplifier of the effect, with level I having value 0. Negative levels are discussed here. Optional, and defaults to level I.
        •  duration: The duration of the effect in ticks. Values 0 or lower are treated as 1. Optional, and defaults to 1 tick.
        •  ambient: 1 or 0 (true/false) - whether or not this is an effect provided by a beacon and therefore should be less intrusive on the screen. Optional, and defaults to false.
        •  show_particles: 1 or 0 (true/false) - whether or not this effect produces particles. Optional, and defaults to true.
        •  show_icon: 1 or 0 (true/false) - true if effect icon is shown. false if no icon is shown.
    •  Potion: The name of the default potion effect. This name differs from the status effect name. For example, the value for an "Instant Health II" potion is "minecraft:strong_healing". A potion or tipped arrow getting its effects from this tag is named with the proper effect. The default value is "minecraft:empty", which gives it the "Uncraftable" name.
    •  CustomPotionColor: The item uses this custom color, and area-of-effect clouds, arrows, and splash and lingering potions use it for their particle effects. This color does not extend, however, to the particles given off by entities who ultimately receive the effect. The numeric color codes are equal to the hex code of the color converted to a decimal number, or can alternatively be calculated from the Red, Green and Blue components using this formula: Red<<16 + Green<<8 + Blue. For positive values larger than 0x00FFFFFF, the top byte is ignored. All negative values produce white.

Armor Trim[]

When armor is trimmed, it has the following NBT:

  •  tag: Parent Tag.
    •  Trim: Properties of Armor Trim.
      •  material: The material which decides the color of armor trim.
      •  pattern: The pattern of armor trim.

Armor Stands, Spawn Eggs and Item Frames[]

Armor stands, spawn eggs and item frames may contain potential entity data.

  •  tag: Parent tag.
    •  EntityTag: Stores entity data that is applied to the entity when created.

Book and Quills[]

Book and quills use NBT data to save their contents.

  •  tag: Parent tag.
    •  pages: The list of pages in the book.
      • : A single page in the book. Each page is a string and uses the escape sequence \n for a line break. However, the command parser does not accept \n, so line breaks need to be set by a player or using loot tables.

Written Books[]

Written books use NBT data to save their contents as well as miscellaneous extra information.

  •  tag: Parent tag.
    •  filtered_pages: [needs testing]
    •  filtered_title: [needs testing]
    •  resolved: Optional. Created and set to 1 when the book (or a book from the stack) is opened for the first time after being created. Used to determine whether to resolve advanced components within JSON, because their values become fixed at that point.
    •  generation: Optional. The copy tier of the book. 0 = original, 1 = copy of original, 2 = copy of copy, 3 = tattered. If the value is greater than 1, the book cannot be copied. Does not exist for original books. If this tag is missing, it is assumed the book is an original. 'Tattered' is unused in normal gameplay, and functions identically to the 'copy of copy' tier.
    •  author: The author of the written book.
    •  title: The title of the written book. Lower priority than the item name set by tag.display.Name. Can not be used to open locked containers.
    •  pages: The list of pages in the book.
      • : A single page in the book. Each page is a serialized JSON text.

Buckets of Aquatic Mob[]

Buckets of aquatic mob may contain potential entity data.

  •  tag: Parent tag.
    •  BucketVariantTag: The variant data of the tropical fish in the bucket. Applies only to Bucket of Tropical Fish.
    •  EntityTag: Stores entity data that is applied to the aquatic mob when it is poured out. If this data includes a tropical fish variant, it overrides the one provided in BucketVariantTag.

Bundle[]

Bundles use NBT data to save what item is stored.

  •  tag: Parent tag.
    •  Items: List of items in the bundle.
      • : An item in the bundle.
        • Tags common to all items

Compasses[]

When used as a lodestone compass, compasses store information about their targeted lodestone.

  •  tag: Parent tag.
    •  LodestoneTracked: Optional. 1 or 0 (true/false) - true if the compass is connected to a lodestone. When false, LodestoneDimension and LodestonePos is not automatically removed when the lodestone is destroyed, but the compass still points to that location.
    •  LodestoneDimension: Optional. The dimension of the lodestone to which the compass is pointing.
    •  LodestonePos: Optional. The coordinates of the lodestone to which the compass is pointing.
      •  X: x coordinate
      •  Y: y coordinate
      •  Z: z coordinate

Crossbows[]

Crossbows use NBT data to save what item is charged in the crossbow

  •  tag: Parent tag.
    •  ChargedProjectiles: The items this crossbow has charged, normally one entry (three if enchanted with multishot)
      • : A charged item.
        • Tags common to all items
    •  Charged: If the crossbow is charged.

Debug Sticks[]

Debug sticks use the NBT to save the block state to edit for each block.

  •  tag: Parent tag.
    •  DebugProperty: A compound where each key is a block ID, and the value is the block state key to edit for that block ID. Block tags are not supported.
      •  Block ID: The block state key of the block to edit, for example "minecraft:oak_fence": "east".

Firework Rockets[]

Firework rockets use the tag tag to store information about their effects.

  •  tag: Parent tag.
    •  Fireworks: One of these may appear on a firework rocket.
      •  Explosions: List of compounds representing each explosion this firework causes.
        • : A firework explosion.
          • Tags common to all firework explosion effects
      •  Flight: Indicates the flight duration of the firework (equals the amount of gunpowder used in crafting the rocket). Can be anything from -128 to 127.

Firework Stars[]

Firework stars use the tag tag to store information about their effects.

  •  tag: Parent tag.
    •  Explosion: The explosion effect contributed by this firework star.
      • Tags common to all firework explosion effects

Maps[]

Maps may be scaled.

  •  tag: Parent tag.
    •  map: The map number.
    •  map_scale_direction: Only internally used when scaling a map, after that directly removed: The amount to increase the current map scale by when crafting. Always 1.
    •  map_to_lock: 1 or 0 (true/false) - true if the map should be locked after being taken out of the cartography table. Only internally used when locking a map, after that directly removed.
    •  Decorations: A list of optional icons to display on the map. Decorations that are removed or modified do not update until the world is reloaded.
      • An individual decoration.
        •  id: An arbitrary unique string identifying the decoration.
        •  type: The ID of the map icon to display.
        •  x: The world X position of the decoration.
        •  z: The world Z position of the decoration.
        •  rot: The rotation of the symbol, ranging from 0.0 to 360.0, measured clockwise. A rotation of 0 displays the icon upside-down compared to its appearance in the icon texture.
    •  display: The display tag.
      •  MapColor: The color of the markings on the item's texture.

Player Heads[]

Heads of the player variety can be associated with a specific username to take on the skin of that player when placed. The hand-held item is also updated with the new skin. Within this section, the "owner" of a head means the player whose head it is a copy of, and a player whose inventory contains a head is called the "holder".

  •  tag: Parent tag.
    •  SkullOwner: The username of the player this is a skull of. This gets converted to the compound version on almost any action.
    •  SkullOwner: Different definition for the skull's owner.
      •  Id: UUID of owner, stored as four ints. Optional. Used to update the other tags when the chunk loads or the holder logs in, in case the owner's name has changed.
      •  Name: Username of owner. If missing or empty, the head appears as a Steve head. Otherwise, used to store or retrieve the downloaded skin in the cache. Need not be a valid player name, but must not be all spaces.
      •  Properties
        •  textures
          • : An individual texture.
            •  Value: A Base64-encoded JSON object.
              •  isPublic: Optional.
              •  signatureRequired
              •  profileId: Optional: The hexadecimal text form of the player's UUID, without hyphens.
              •  profileName: Optional: Player name.
              •  textures
                •  CAPE: Optional.
                  •  url: URL of a player cape (64x32 PNG).
                •  SKIN
                  •  url: URL of a player skin on textures.minecraft.net.
                  •  metadata
                    •  model: The model of the player skin. Can be "classic" or "slim".
              •  timestamp: Optional: Unix time in milliseconds.
            •  Signature: Optional.

Suspicious Stew[]

Suspicious stews store their potion effects.

  •  tag: Parent tag.
    •  Effects: The status effects this suspicious stew has.
      • One of these for each effect.
        •  EffectId: The numeric ID of the effect.
        •  EffectDuration: The duration of the effect in ticks. Values 0 or lower are treated as 1. Optional, and defaults to 160 ticks (8 seconds).

Inventory slot numbers[]

This shows the numbers used to specify the slot in the inventory while editing with an NBT editor.

History[]

Clock JE3
This section needs to be updated. 
Please update this section to reflect recent updates or newly available information.
Reason: Almost certainly missing a lot of prior history
Java Edition
1.7.2?Added Unbreakable tag for tools.
1.814w06aAdded CanDestroy for tools.
Added HideFlags to items.
14w07aAdded BlockEntityTag for all blocks.
14w10aAdded a 5th bit (value of 32) to HideFlags that hides potion effects.
14w33aAdded SelectedItem for all items.
1.12pre1Added enteredNetherPosition to players, for use with the minecraft:nether_travel advancement trigger.
1.1318w01aName tag is now a text component.
Removed the LocName tag. Instead of LocName:"gui.toTitle", use Name:"{\"translate\":\"gui.toTitle\"}".
18w21aench tag has been renamed Enchantments.
1.1418w43aLore tag is now a text component.
Added CustomModelData tag to set custom item model with resource packs.
19w06aAdded BlockStateTag for item forms of blocks.
1.16.220w27aAdded Flag 64 to HideFlags to hide "Dyed" on leather armor.[3]
1.17.1Pre-release 1Enchantments[].lvl tag is now read as short and clamped between 0 and 255.[4]
1.1922w14aAdded LastDeathLocation, together with the recovery compass.
1.19.423w04aAdded flag 128 to HideFlags to hide armor trim tooltips.
Upcoming Java Edition
1.20.223w32aIn NBT format for item type potion, lingering_potion, splash_potion, and tipped_arrow, renamed CustomPotionEffects to custom_potion_effects.
In NBT format for item type suspicious_stew, renamed Effects to effects, also changed following fields in this field: EffectId (integer) -> id (string, resource location), EffectDuration -> duration

References[]

  1. Assuming the block is of a type that creates a block entity at all. If not, BlockEntityTag has no effect.
  2. For positive values larger than 0x00FFFFFF, the top byte is ignored. All negative values produce white.
  3. MC-49476
  4. MC-131290
Advertisement