Commands/data

Allows the player to get, merge, and remove block entity and entity NBT data.


 * Syntax




 * Arguments


 * pos
 * Specifies the position of the block.


 * target
 * Specifies the target entity.


 * path (Optional)
 * Specifies the path to the targeted NBT.
 * Data paths look like this:.
 * means foo's child called bar.
 * means element 0 of foo.
 * "quoted strings" may be used if a name of a key needs to be escaped.


 * scale (Optional)
 * Scales the number retrieved from.


 * nbt
 * Specifies the NBT tag to be merged/removed.


 * Result


 * Fails if the arguments are not specified correctly.


 * On success:
 * — Return value depends on what arguments are specified.
 * No additional arguments
 * Sends the entire NBT data from the block at pos or one target entity to the executor with syntax highlighting, and returns 1.
 * Only path
 * Sends the subsection of the NBT data from the block at pos or one target entity to the executor without syntax highlighting. Return value depends on the type of the NBT element:
 * Retrieving a number will return that number.
 * Retrieving a string will return the length of the string.
 * Retrieving a list will return the number of elements in that list.
 * Retrieving a compound will return the number of tags that are direct children of that compound.
 * Both path and scale
 * Requires a numeric value to be at the end of the path. Returns that numeric value scaled by scale.
 * — Merges the block NBT data at pos or from the target entity with the specified nbt data. Returns 1 on success.
 * — Will remove NBT data at path from the block at pos or from one target entity. Removing player NBT data is not allowed. Returns 1 on success.

History
命令/data