Minecraftddata instruction

This feature is unique to the Java version.data

Permissions level 2
Limited conditions None

/data command allows executors to obtain, merge, modify or remove NBT data stored in the block, entity or command storage.

grammar

/Data There are four sub -commands ( Get , Merge , Modify , Remove )Essence

data ... ... Get (Block | Entity | STORAGE ) [] [] Get designated specifiedNBT value. ... Merge (BLOCK | Entity | Storage ) will specify merged NBT and . ... Modify (Block | Entity | Storage ) ... Modify specifies NBT ...

... Append ... ... Insert a value at the end of the list ... ... insert ... Insert a value in the specified position of the list ... ... Merge ... ... merge the specified composite NBT with another value ... ... Prepend ... ... Insert a value in front of the list ... ... set ... ... cover the NBT as a new value ...

... From (BLOM | Entity | Storage ) [] … Specify NBT with specific blocks, entities or storage. ... String (Block | Entity | Storage ) [] [] [] < /code> [New: Je 1.19.4] ... Use a sub -string in a specified NBT with a specific square, entity or storage. ... value ... Use . ... Remove (Block | Entity | Storage ) Delete specified NBT.Show grammatical grammar tree simplified in various ways: detailed grammar tree: compressed grammar tree: chart: streamlined version: expansion version: parameter : block_pos

Specify the coordinates of a block that needs to change the NBT tag.It must be a block coordinate, including , , and . Each value must be an integer or a wave number and the deficit number mark.

: Entity (only Entity mode)

Specify the entity that needs to change the NBT label.It must be the player's name, target selector or UUID.And the target selector allows only one entity.

: Resource_Location

Specify the storage of the NBT label.Must be named space ID.

: NBT_PATH

Specify the path of NBT.It must be the NBT path.

: double

NBT specific values ​​of zooming rate.It must be a dual -precision floating point number.

: nbt_compound_tag

Specify a composite label to be merged.The composite type NBT in the SNBT format must be.

: NBT_PATH

The legal path of the specified NBT.It must be the NBT path.

: Integer

Specify the element location in a list.It must be a 32 -bit integer value.And must be between -2147483648 and 2147483647 (inclusive).

: block_pos

You need to use a square coordinate of its NBT tag.It must be a block coordinate, including , , and . Each value must be an integer or a wave number and the deficit number mark.

: Entity

You need to use the entity of its NBT tag.It must be the player's name, target selector or UUID.And the target selector allows only one entity.

: Resource_Location

You need to use its NBT label storage.Must be named space ID.

: nbt_path

Use the legal path name of NBT.It must be the NBT path.

: Integer needs to be an index value of the first character contained in the source string (starting from 0) when extracting sub -string.It must be a 32 -bit integer value.And must be between 0 and 2147483647.

When extracting the sub -string, the index value of the first character that is excluded from the source string (starting from 0).It must be a 32 -bit integer value.And must be between 0 and 2147483647.

: nbt_tag

Modify the value you need to use the target NBT.Must be in line with data types.It must be any type of NBT in the SNBT format.Effect

TR> /Data Get ... TR Align = "Center"> Specify the root tag

No existence

Align = "Center">
Command triggering conditions java version
Any Parameters are incorrect
Located outside the world or it has not been loaded Execution Failure
The squares located in are not block entities
td rowspan = "1"> /data get ... Get multiple tags
Nothing
/Data Get ... >
/Data Merge .../Data Remove .../Data Modify ... No NBT
Try to change the player's nbt
/Data Remove .../Data Modify ... Set ...
/data modify ... (from | string [NewAdd: je 1.19.4]) Block ... Align = "Center"> The blocks located in are not square entities
/Data Modify ... (From | String [New: Je 1.19.4]) Entity ... It cannot be parsed as a single entity (designated players must be online)
/datamodify ... (from | string [New: Je 1.19.4] ...
/data modify ... string ... [New: Je 1.19.4] is not a string andCannot be converted to string
or beyond the range (0 ~231-1)
greater than
Maximum Value Value of the Surgical String
/data modify ... Append .../Data Modify ... Insert .../Data Modify ... Prefend ... > The specified label is not a array or list
The type of source data is not applicable to the list
/data modify ... insert The index is invalid
/Data Modify ... Merge ... The specified nbt is not a composite label
Source NBT is not a composite label
Any When the execution is successful Read, merge, modify or delete specified NBT. For details, see below:
If successful:

/data get /data get ... Returns the NBT data of the target block or the entity, and has a high grammar.If applicable, the return value of success is 1./data get ... Returns the NBT data of the target block or part of the entity, which also has high grammar.The return value depends on the type of NBT element obtained.

Get a number, the return value is the number.Get a string and return the length of the string.Getting a list will return the number of elements in the list.Getting a composite label will return the number of sub -sub -elements (excluding sub -elements of sub -element) in the label./data get ... Back to the value of the label and multiply to .At this time, < needs to point to a number of digital types, that is, the type of the tag can be tag_byte , tag_short , tag_int , tag_long , tag_float or tag_double ./Data Merge Merge the specific NBT data of the target block or entity with the specified data./data modify APPEND adds an element at the end of the specified list. must specify a tag_list element, and source data should be applied to an element in the list. Insert Insert data into the specified list with the element, and the subsequent element number will be automatically added. must specify a tag_list element, and source data should be applied to an element in the list. Merge merge source data with the specified object. must specify a tag_list element, the source data must be tag_compound type. Prepend adds an element to the beginning of the specified list. must specify a tag_list element, and source data should be applied to an element in the list. set Set the label specified as source data.If applicable, the return value of success is 1./Data Remove Remove the NBT data pointed to the specified block or entity.NBT data cannot be removed.If applicable, the return value of success is 1.Output

TD> 1
Command Successful successNumber /Execute Store Success ... /execute Store Result ...
Any java version /td> 0 0
/data get ... Successful execution 1 1
/data get ... Get digital tags 1 The value obtained after taking down [1]
Obtain a list or array label 1 1 The number of elements contained in this list or array
Get the string tag 1 The length of the string
Get the composite label 1 The number of first -level sub -tags contained in this composite label
/data get ... 1 1 Value obtained by.class = "Reference"> [2]
/Data Merge ... Successful execution 1
/Data Remove ... Successful execution 1 1
/data model ... Append .../data modified ... INSERT

.../Data Modify ... Prefend ...

Successful execution 1 Add the number of lists or arrays of the new element
/data modify ... set ... Successful execution 1 Number= "Center"> /Data Modify ... Merge ... Successful execution 1 1 Number of target composite labels that have been successfully changed
NBT path Main strip: nbt path format storage. See command storage format format formatThe commands saved using NBT data are effective methods for accessing or storing NBT data, and they do not need to read or write NBT data through block entities or entities.

Each command storage saves the general key value pair.Command storage uses named space ID to distinguish.

/Data Get and /Data Modify can be read and stored, and /data Merge /data modify/data remove/execute storeCan be written in storage.

The command storage can also be read through the original JSON text.

Example Get the saturation of the executor: /data get entity @S FoodsaturationLevel so that the closest items in 10 grids cannot be picked up by the player: /data modified @e [type = item, distance, distance= .. 10, Limit = 1, Sort = Next] Pickupdelay Set Value -1 Get the Y -axis position of random items: /data get entity @e [type = item, limit = 1, sort = 1, sort =Random] POS [1] Get the naming space of the recent player fast column. Id: /data get entity @P Inventory [{slot: 0b}]. ID (0, 64, 0) The armor attributes of the recent dolphin are set to 20: /data modify entity @e [x = 0, y = 64, z = 0, type = dolphin, limit = 1] Attributes [attributes [{Name: "Minecraft: Generic.armor"}].. Base Set Value 20 Set the first item in (1, 64, 1) to be diamond (retaining other NBT):/Data Modify Block 1 64 1 ITEMS [0] .id Set Value "Minecraft: Diamond_block" adjusted the drop of the recent zombie deputy items to 80%, and the probability of the main items was adjusted.It is 0%: /Data Merge Entity @E [Type = Zombie, Limit = 1, SORT = NEAREST] {handdropchances: [0F, 0.8F]}