NBT Tags for Player in Minecraft (Java Edition 1.14/1.15)

This Minecraft tutorial explains the NBT tags (formerly called data tags) that you can use for a player in Minecraft Java Edition (PC/Mac) 1.14 and 1.15.

TIP: If you are not running Minecraft Java Edition (PC/Mac) 1.14/1.15, find NBT tags for player in another version of Minecraft:

Background

Players have a unique set of NBT tags that can be used in Minecraft commands such as: /data and /scoreboard.

player

What are NBT tags (formerly called Data Tags)?

NBT tags allow you to set certain properties of a player. The NBT tag is always surrounded in {} such as {Dimension:0}. If there is more than one NBT tag used in a game command, the NBT tags are separated by a comma such as {Dimension:0, foodLevel:20}.

List of NBT Tags

Here is a list of the NBT tags that you can use for a player in Minecraft Java Edition (PC/Mac) 1.14 and 1.15:

NBT Tag Value (Description)
abilities

data (The abilities that the player has.)

  • invulnerable - determines whether the player take damage like normal (0 or 1)
  • mayfly - determines whether the player can fly (0 or 1)
  • instabuild - demeterines whether the player can instantly place or destroy blocks (0 or 1)
  • walkSpeed - the speed that the player can walk (default is 0.1f)
  • mayBuild - determines whether the player is allowed to build by placing or destroying block (0 or 1)
  • flying - the player is currently flying (0 or 1)
  • flySpeed - the speed that the player can fly (default is 0.05f)

Example
{abilities:{invulnerable:1,mayfly:1,instabuild:1,walkSpeed:0.1f,mayBuild:1,flying:0,flySpeed:0.05f}}

AbsorptionAmount

number (The number of absorption health points the player has)

Example
{AbsorptionAmount:2.0f}

DataVersion

version (The version of the player's NBT structure. Each version/snapshot of Minecraft has its own unique version number. Minecraft 1.14.2 has a DataVersion value of 1963)

Example
{DataVersion:1963}

Dimension

-1 (The player is the Nether)
0 (The player is in the Overworld)
1 (The player is in the End)

Example
{Dimension:0}

EnderItems

data (An item in the player's ender chest)

Example
{EnderItems:[{id:"minecraft:diamond_sword"}]}

foodLevel

number (The level in the Hunger bar. A full Hunger bar has a value of 20)

Example
{foodLevel:20}

foodExhaustionLevel

number (The level of exhaustion)

Example
{foodExhaustionLevel:0}

foodSaturationLevel

number (The current level of saturation)

Example
{foodSaturationLevel:5}

foodTickTimer

ticks (The value of the Food timer in game ticks)

Example
{foodTickTimer:0}

Health

number (The number of health points the player has)

Example
{Health:20.0f}

Inventory

data (An item in the player's inventory)

Example
{Inventory:[{id:"minecraft:diamond_sword"}]}

Invulnerable

0 (The player will take damage like normal)
1 (The player will not take any damage from attacks or physical surroundings)

Example
{Invulnerable:0}

playerGameType

0 (The player is in Survival mode)
1 (The player is in Creative mode)
2 (The player is in Adventure mode)
3 (The player is in Spectator mode)

Example
{playerGameType:1}

PortalCooldown

ticks (The number of game ticks until the player can go through a portal again - there are 20 ticks in a second)

Example
{PortalCooldown:120}

recipeBook

data (A list of the recipes the player knows how to craft)

Example
{recipeBook: {recipes:["minecraft:diamond_sword"]}}

rootVehicle

data (The entity that the player is currently sitting on)

Example
{rootVehicle:{id:"minecraft:horse"}}

Score

number (The value that will be displayed as the Score when the player dies)

Example
{Score:126}

seenCredits

0 (The player has not yet gone into the final portal that ends the game and seen the credits)
1 (The player has gone into the final portal that ends the game and has seen the credits)

Example
{seenCredits:0}

SelectedItem

data (The item that is currently selected in the hotbar)

Example
{SelectedItem:{id:"minecraft:diamond_sword"}}

SelectedItemSlot

number (The hotbar slot that the player currently has selected. The first slot is 0, second slot is 1, and so on)

Example
{SelectedItemSlot:0}

ShoulderEntityLeft

data (The entity sitting on the player's left shoulder. Currently, this can only be a parrot)

Example
{ShoulderEntityLeft:{id:"minecraft:parrot"}}

ShoulderEntityRight

data (The entity sitting on the player's right shoulder. Currently, this can only be a parrot)

Example
{ShoulderEntityRight:{id:"minecraft:parrot"}}

SleepingX

number (The X coordinate of where the player is sleeping)

Example
{SleepingX:-851}

SleepingY

number (The Y coordinate of where the player is sleeping)

Example
{SleepingY:66}

SleepingZ

number (The Z coordinate of where the player is sleeping)

Example
{SleepingZ:193}

SleepTimer

ticks (The number of game ticks that the player has been sleeping in a bed)

Example
{SleepTimer:2400}

SpawnForced

0 (The player will not spawn if no bed is found)
1 (The player will spawn if no bed is found)

Example
{SpawnForced:0}

SpawnX

number (The X coordinate of the player's bed or spawn point)

Example
{SpawnX:520}

SpawnY

number (The Y coordinate of the player's bed or spawn point)

Example
{SpawnY:97}

SpawnZ

number (The Z coordinate of the player's bed or spawn point)

Example
{SpawnZ:101}

XpLevel

number (The level on the experience bar)

Example
{XpLevel:20}

XpP

number (The percentage on the experience bar until the next level)

Example
{XpP:50}

XpSeed

number (The seed that will be used for the next enchantment when using an enchanting table)

Example
{XpSeed:12345}

XpTotal

number (The total XP earned during the current life. This value is displayed as the Score when player dies)

Example
{XpTotal:126}

NBT Tag Examples

To get the NBT tags (or data tags) for the nearest player:

/data get entity @p

Next, learn how to use the game commands in Minecraft.