data get entity майнкрафт

How to Use the Data Command in Minecraft

This Minecraft tutorial explains how to use the /data command with screenshots and step-by-step instructions.

You can use the /data command to get, merge and remove NBT tags (formerly called data tags) for entities and block entities. The /data command is most useful for changing attributes of a mob after the mob has spawned or modifying attributes of a block entity after you have placed it.

Let’s explore how to use this cheat (game command).

Supported Platforms

The /data command is available in the following versions of Minecraft:

Platform Supported (Version*)
Java Edition (PC/Mac) Yes (1.13)
Pocket Edition (PE) No
Xbox 360 No
Xbox One No
PS3 No
PS4 No
Wii U No
Nintendo Switch No
Windows 10 Edition No
Education Edition No

* The version that it was added or removed, if applicable.
NOTE: Pocket Edition (PE), Xbox One, PS4, Nintendo Switch, and Windows 10 Edition are now called Bedrock Edition. We will continue to show them individually for version history.

Requirements

To run game commands in Minecraft, you have to turn cheats on in your world.

Data Command

Data Command in Minecraft Java Edition (PC/Mac)

In Minecraft Java Edition (PC/Mac), there are different syntaxes depending on what you would like to do with the NBT tag (formerly called data tag).

To get the NBT tag for a block entity:

To get the NBT tag for an entity:

To merge the NBT tags for a block entity:

To merge the NBT tags for an entity:

To remove the NBT tags at path for a block entity:

To remove the NBT tags at path for an entity:

Definitions

Examples

Example in Java Edition (PC/Mac)

To change the name of one cow to Duke in Minecraft Java Edition (PC/Mac):

To get all NBT tag information for one player that is in Creative mode:

To get all NBT tag information for a chest at coordinates (329, 68, 91):

How to Enter the Command

1. Open the Chat Window

The easiest way to run a command in Minecraft is within the chat window. The game control to open the chat window depends on the version of Minecraft:

2. Type the Command

In this example, we are going to retrieve all of the NBT information for a block entity such as a chest.

To get the NBT tags for a chest at the coordinates (329, 68, 91), we would type the following command in Minecraft Java Edition (PC/Mac) 1.13:

Type the command in the chat window. As you are typing, you will see the command appear in the lower left corner of the game window. Press the Enter key to run the command.

Once the cheat has been entered, all of the NBT tags will be listed in the lower left corner of the game window.

In this example, the /data command returns the following NBT tags for the chest at 329, 68, 91:

Now we can see the x y z coordinates of the chest, all of the items inside the chest (ie: diamond sword, iron helmet, iron chestplate, iron leggings and iron boots) and the lock information for the chest.

Congratulations, you have learned how to use the /data command in Minecraft.

Other Game Commands

You can use other commands and cheats in Minecraft such as:

Источник

Using nbt paths in minecraft. 1.14 (/data modify|get)

Tutorial:How to use paths properly

-this tutorial is for the

part of the syntax of the «new» /data command

-this is a pretty advanced tutorial about json and nbt tags and you might want to do some research about that first

-key/value: if you don’t know at all about nbt tags in minecraft, try typing /data get entity @s, you should get something like 
these are the nbt tags of the player, (or it’ data), it’s composed of keys and values, basically, keys are before «:» and values are after it.

Читайте также:  как сменить часовой пояс на компьютере виндовс 10

-a key:value set : i will call that a set or a tag during this tutorial

— keys are always strings

-the root object is the object in which everything is stored, the < >we see around the data

— < >and [ ] will be used instead of <> and [] for clarity but remember to remove the spacing in actual code

the basics of the paths

in minecraft, path refers to a modified version of JSONpath, a syntax used to search values in json objects.

Let’s create an example minecraft object for this tutorial:

finding values in arrays or lists :

for this, another example is used: values:[
sand
gravel
stone
grass
.
sponge
]

value sand gravel stone grass sponge
positive index 0 1 2 3 4
negative index -5 -4 -3 -2 -1

r ecursive research : indexes are always integers, except when they aren’t

Источник

Commands/data

The /data command allows the user to get, merge, modify, and remove NBT data of a block entity, entity, or Command NBT storage.

Contents

Syntax [ ]

Removes NBT data at

from the targeted block position or entity. Player NBT data cannot be removed.

Syntax displayed in various ways

Maximised:
data get block [

] [ ] data merge block data merge entity data merge storage data modify block append from block data modify block append from entity data modify block append from storage data modify block append value data modify block insert index> from block data modify block insert from entity data modify block insert from storage data modify block insert value data modify block merge from block data modify block merge from entity data modify block merge from storage data modify block merge value data modify block prepend from block data modify block prepend from entity data modify block prepend from storage data modify block prepend value data modify block set from block data modify block set from entity data modify block set from storage data modify block set value data modify entity append from block data modify entity append from entity data modify entity append from storage data modify entity append value data modify entity insert from block data modify entity insert from entity data modify entity insert from storage data modify entity insert value data modify entity merge from block data modify entity merge from entity data modify entity merge from storage data modify entity merge value data modify entity prepend from block data modify entity prepend from entity data modify entity prepend from storage data modify entity prepend value data modify entity set from block data modify entity set from entity data modify entity set from storage data modify entity set value data modify storage append from block data modify storage append from entity data modify storage append from storage data modify storage append value data modify storage insert from block data modify storage insert from entity data modify storage insert from storage data modify storage insert value data modify storage merge from block data modify storage merge from entity data modify storage merge from storage data modify storage merge value data modify storage prepend from block data modify storage prepend from entity data modify storage prepend from storage data modify storage prepend value data modify storage set from block data modify storage set from entity data modify storage set from storage data modify storage set value data remove block

data remove entity

data remove storage

Arguments [ ]

Specifies an entity whose NBT is to be operated on. Must be a player name, a target selector or a UUID. And the target selector must be of single type.

Specifies a storage to be operated on. Must be a resource location.

Specifies the NBT to retrieve or remove. Must be an NBT path.

Scalar for the command’s return value. Must be a Double-precision floating-point format number.

Specifies a compound tag to be merged into somewhere. Must be a compound NBT in SNBT format.

Specifies target NBT to modify. Must be an NBT path.

Specifies an item’s index within a list. Must be a 32-bit integer number.

Value used in modifying the target NBT. Should match its data type. Must be an NBT tag of any type in SNBT format.

Result [ ]

Output [ ]

Examples [ ]

Storage [ ]

The command storage of NBT data is an efficient way for commands to access or save NBT data without an overhead for block entities or entities reading from or writing to the NBT data.

Each command storage is a general purpose, key-value storage, identified by a resource location to prevent unintentional conflicts.

The command storage is accessible with JSON text as well.

Источник

NBT Tags for Player in Minecraft (Java Edition 1.16)

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.16.

TIP: If you are not running Minecraft Java Edition (PC/Mac) 1.16, 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.

What are NBT tags (formerly called Data Tags)?

NBT tags (formerly called data tags) allow you to set certain properties of a player. The NBT tag is always surrounded in <> such as . If there is more than one NBT tag used in a game command, the NBT tags are separated by a comma such as .

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.16:

data (The abilities that the the player has.)

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

ticks (The number of game ticks the player has air left for)

version (The version of the player’s NBT structure. Each version/snapshot of Minecraft has its own unique version number. Minecraft 1.16 rc-1 has a DataVersion value of 2565)

number (The number of game ticks that the player has been dead. When alive, DeathTime has a value of 0)

minecraft:the_nether (The player is the Nether)
minecraft:overworld (The player is in the Overworld)
minecraft:the_end (The player is in the End)

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

coordinate (The xyz coordinate value where the player entered the Nether dimension)

number (The distance that the player has fallen)

0 (The player is not allowed to use elytra when falling)
1 (The player is allowed to use elytra when falling)

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

number (The level of exhaustion)

number (The current level of saturation)

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

number (The number of health points the player has)

ticks (The number of game ticks that the player turns red after being hurt)

data (An item in the player’s inventory)

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

0 (The player is not on the ground)
1 (The player is on the ground)

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)

coordinate (The xyz coordinate value where the player is currently positioned)

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

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

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

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

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)

0 (The player has the slot #1 selected in the hot bar)
1 (The player has the slot #2 selected in the hot bar)
2 (The player has the slot #3 selected in the hot bar)
3 (The player has the slot #4 selected in the hot bar)
4 (The player has the slot #5 selected in the hot bar)
5 (The player has the slot #6 selected in the hot bar)
6 (The player has the slot #7 selected in the hot bar)
7 (The player has the slot #8 selected in the hot bar)
8 (The player has the slot #9 selected in the hot bar)

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

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

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

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

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

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

minecraft:the_nether (The player will spawn in the Nether)
minecraft:overworld (The player will spawn in the Overworld)
minecraft:the_end (The player will spawn in the End)

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

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

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

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

number (The level on the experience bar)

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

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

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

NBT Tag Examples

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

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

Other NBT Tags

Here are some of the other NBT tags (formerly called data tags) in Minecraft:

Источник

Using nbt paths in minecraft. 1.14 (/data modify|get)

Tutorial:How to use paths properly

-this tutorial is for the

part of the syntax of the «new» /data command

-this is a pretty advanced tutorial about json and nbt tags and you might want to do some research about that first

-key/value: if you don’t know at all about nbt tags in minecraft, try typing /data get entity @s, you should get something like 
these are the nbt tags of the player, (or it’ data), it’s composed of keys and values, basically, keys are before «:» and values are after it.

-a key:value set : i will call that a set or a tag during this tutorial

— keys are always strings

-the root object is the object in which everything is stored, the < >we see around the data

— < >and [ ] will be used instead of <> and [] for clarity but remember to remove the spacing in actual code

the basics of the paths

in minecraft, path refers to a modified version of JSONpath, a syntax used to search values in json objects.

Let’s create an example minecraft object for this tutorial:

finding values in arrays or lists :

for this, another example is used: values:[
sand
gravel
stone
grass
.
sponge
]

NBT Tag Value (Description)
abilities
value sand gravel stone grass sponge
positive index 0 1 2 3 4
negative index -5 -4 -3 -2 -1

r ecursive research : indexes are always integers, except when they aren’t

Источник

Читайте также:  как установить node js на windows глобально
Компьютерный онлайн портал