root tag must be a named compound tag что делать майнкрафт

NBT format

The Named Binary Tag (NBT) format is used by Minecraft for the various files in which it saves data. The format is designed to store data in a tree structure made up of various tags. All tags have an ID and a name.

Another more user-friendly format of NBT is in plain string, as used in commands. This format is referred to as SNBT, short for stringified NBT.

Contents

SNBT format [ ]

SNBT, also known as data tag, is often used in command in Java Edition. It can be described starting with attribute-value pairs enclosed in curly braces. One common usage of data tags in Java Edition is in commands, used to specify complex data for any entity.

A data tag consists of zero or more attribute-value pairs delimited by commas and enclosed in curly braces. Each attribute-value pair consists of an tag name and the tag’s value, separated by a colon. Some values, however, may be a compound tag and themselves contain attribute-value pairs, allowing a data tag to describe a hierarchical data structure.

Tag’s name can be enclosed with double quotes if necessary.

It is different from the JSON format; hence, any JSON used in NBT, such as raw JSON text, must be enclosed within a string tag.

Format of each type [ ]

The defined data structures also expect the values to be of the correct type.

» ( » within needs to be escaped to \» ), or ‘

‘ ( ‘ within needs to be escaped to \’ )

Each tag can be of any type.

NBT object [ ]

When the game is running, entities and block entities in loading chunks are stored in the memory. They are not stored with NBT, instead, they are just programmatic objects.

When processing NBT operations, the game needs to generate programmatic NBT object from entities/block entities, parse SNBT into NBT object, modify entities/blocks based on provided NBT object, or convert NBT object into SNBT.

Generating NBT object [ ]

When generating NBT from an entity/block, the entity/block’s properties are added into programmatic NBT object.

Note that not all properties are added. For example, the value of whether a player is opening a chest won’t be added into NBT object.

A value is added with certain data type. For example, a resource location will be converted to a string value.

These NBT objects will also be stored into game’s save files as NBT files when the game quits or automatically saves. So the data structures that NBT tags describe and the data type for each tag are basically the same ones used in game’s save files. These data structures are described in other articles and commands expect data tags to use the same attribute names (which are case-sensitive):

Data Structure Specification Links

Objects Examples
Block entities chests, furnaces, command blocks, mob spawners, signs, etc.
Items items in inventories (includes specifications for enchantments, lore, custom names, etc.)
Item entities items on the ground
Mobs creepers, cows, villagers, etc.
Projectiles arrows, fireballs, thrown potions, etc.
Vehicles boats, minecarts, etc.
Dynamic tiles primed TNT, falling sand/gravel/concrete powder/anvils
Other entities firework rockets, paintings, and item frames

Conversion to SNBT [ ]

A programmatic NBT object would be converted to a SNBT when trying to get it with /data get etc.

And a string is always enclosed by double or single quotes.

Other data types are expressed as the #Format of each type table above.

Conversion from SNBT [ ]

An SNBT will be converted to a programmatic NBT object when parsed by the game.

A number that followed by a letter (B, S, L, F, D, or their lowercase) is resolved to corresponding data type. For example, 3s for a short, 3.2f for a float, etc. The letter can be uppercase or lowercase. When no letter is used, it assumes double if there’s a decimal point, int if there’s no decimal point and the size fits within 32 bits, or string if neither is true.

A square-bracketed literal is assumed to be a list unless an identifier is used: [I;1,2,3] for an int array and [L;1L,2L,3L] for a long array.

true and false are converted as 1b and 0b respectively.

Modifying entity/block based on NBT object [ ]

Modifying entity/block based on a programmatic NBT object is not a simple progress. All certain tags need to be resolved before changing properties of a block/entity. Note that only certain properties can be changed. For example, when using /data command to modify a block entity, its coordinates cannot be changed.

If a property needs a value of resource location and gets a string tag, the string will be converted to a resource location.

If a property needs a value of JSON text and gets a string tag, the string will be parsed into JSON text object.

If a property needs a numeric value of certain type and gets a numeric tag of wrong type, the number will get some rounding operation and converts to the required type.

If a property needs a numeric value and gets a non-numeric tag, the number will become 0.

If a property needs a string value and gets a non-string tag, the string will become an empty string.

Читайте также:  как сделать защиту в майнкрафте на сервере

If a property needs a list or array of certain type and gets a wrong-type tag, a empty list/array will be got.

If a property needs a compount tag and gets a non-compount tag, a empty compount tag will be got.

Testing NBT tags [ ]

They check only for the presence of the provided tags in the target entity/block/storage. This means that the entity/block/storage can have additional tags and still match. This is true even for lists: the order and number of elements in an list a list is not considered, and as long as every requested element is in the list, it matches even if there are additional elements. For example, an entity with data can be targeted by @e[nbt=] or even just @e[nbt=] even though the former represents a totally different position and the latter is not a valid position at all. Note that @e[nbt=] can’t match it, because an empty list can only match empty list.

However, the order and number of elements in an byte/long/int array is acknowledged.

NBT file [ ]

An NBT file is a zipped Compound tag, with the name and tag ID included. The file in the zip must contain the Compound tag that it is as the first bytes. Some of the files utilized by Minecraft may be uncompressed, but in most cases, the files follow Notch’s original specification and are compressed with GZip.

TAG definition [ ]

A tag is an individual part of the data tree. The first byte in a tag is the tag type (ID), followed by a two byte big-endian unsigned integer for the length of the name, then the name as a string in UTF-8 format (Note TAG_End is not named and does not contain the extra 2 bytes; the name is assumed to be empty). Finally, depending on the type of the tag, the bytes that follow are part of that tag’s payload. This table describes each of the 13 known tags in version 19133 of the NBT format:

The List and Compound tags can be and often are recursively nested. It should also be noted that, in a list of lists, each of the sub-lists can list a different kind of tag.

Usage [ ]

Minecraft sometimes uses the NBT format inconsistently; in some instances, empty lists may be represented as a list of Byte tags rather than a list of the correct type, or as a list of End tags in newer versions of Minecraft, which can break some older NBT tools. Additionally, almost every root tag has an empty name string and encapsulates only one Compound tag with the actual data and a name. For instance:

Additionally, there is also inconsistent use of letter case, mostly either camelCase or PascalCase, but sometimes even in all lowercase.

Источник

Argument types

This page contains a list of all command argument types.

Contents

Java Edition [ ]

brigadier:bool [ ]

Must be a boolean (either true or false ).

brigadier:double [ ]

Each double argument may have a custom minimum and maximum value.

JSON properties in command syntax output

brigadier:float [ ]

Each float argument type may have a custom minimum and maximum value.

JSON properties in command syntax output

brigadier:integer [ ]

Must be a 32-bit integer number.

Each integer argument type may have a custom minimum and maximum value.

Maximum range is from −(2 31 ) to (2 31 − 1), or from (−2,147,483,648) to (2,147,483,647).

JSON properties in command syntax output

brigadier:long [ ]

Must be a 64-bit long.

Note: Although a long argument type is present in brigadier, it is not used by Minecraft.

Each long argument type may have a custom minimum and maximum value.

Maximum range is from −(2 63 ) to (2 63 −1), or from (−9,223,372,036,854,775,808) to (9,223,372,036,854,775,807).

JSON properties in command syntax output

brigadier:string [ ]

Each string argument type can accept either a single word (no spaces), a quotable phrase (either single word or quoted string), or a greedy phrase (taking the rest of the command as the string argument).

JSON properties in command syntax output

minecraft:angle [ ]

minecraft:block_pos [ ]

minecraft:block_predicate [ ]

minecraft:block_state [ ]

minecraft:color [ ]

Must be a team color ( reset or one of the 16 chat colors.)

minecraft:column_pos [ ]

minecraft:component [ ]

minecraft:dimension [ ]

minecraft:entity [ ]

Must be a player name, a target selector or a UUID.

Each entity argument may place limits on the number of entities (single/multiple) selected or the type of entities (player/any entity) selected.

JSON properties in command syntax output

minecraft:entity_anchor [ ]

minecraft:entity_summon [ ]

Must be an entity type in the format of resource location of a summonable entity type.

minecraft:float_range [ ]

minecraft:function [ ]

minecraft:game_profile [ ]

Must be a collection of game profiles (player profiles), which can be a player name (must be a real one if the server is in online mode), or a player-type target selector.

minecraft:int_range [ ]

minecraft:item_enchantment [ ]

Must be an ID of an enchantment.

minecraft:item_predicate [ ]

minecraft:item_slot [ ]

Must be a string notation that refer to certain slots in the inventory.

The slot reference is mapped to an integer.

Slot Valid slot_number Mapped index
armor.chest 102
armor.feet 100
armor.head 103
armor.legs 101
weapon 98
weapon.mainhand 98
weapon.offhand 99
container.slot_number 0-53 0-53
enderchest.slot_number 0-26 200-226
hotbar.slot_number 0-8 0-8
inventory.slot_number 0-26 9-35
horse.saddle 400
horse.chest 499
horse.armor 401
horse.slot_number 0-14 500-514
villager.slot_number 0-7 300-307
Читайте также:  как в майнкрафт сделать торнадо

Then, restrictions are applied to mapped indexes.

Mapped index Restrictions
0-53 General inventories
98-103 Mobs, players, and armor stands
200-226 Players
300-307 Villagers, pillagers
400-401 Horses, donkeys
499-514 Donkeys with chest

minecraft:item_stack [ ]

minecraft:message [ ]

minecraft:mob_effect [ ]

Must be an ID of a status effect.

minecraft:nbt_compound_tag [ ]

Must be a compound NBT in SNBT format.

minecraft:nbt_path [ ]

foo.bar[0].»A [crazy name]».baz.

minecraft:nbt_tag [ ]

Must be an NBT tag of any type in SNBT format.

minecraft:objective [ ]

minecraft:objective_criteria [ ]

minecraft:operation [ ]

minecraft:particle [ ]

It must be a resource location of a particle followed by particle parameters that are particle-specific.

Источник

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.

Источник

How to Use the Tag Command in Minecraft

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

You can add, list and remove player tags using the /tag command in Minecraft. This is a very useful command to target and tag players in a multiplayer game.

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

Supported Platforms

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

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

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

Tag Command

Tag 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 tags.

To add a tag to a player:

To list the tags for a player:

To remove a tag from a player:

Definitions

Tag Command in Minecraft Java Edition (PC/Mac)

In Minecraft Pocket Edition (PE), there are different syntaxes depending on what you would like to do with the tags.

To add a tag to a player:

To list the tags for a player:

To remove a tag from a player:

Definitions

Tag Command in Minecraft Xbox One Edition

In Minecraft Xbox One Edition, there are different syntaxes depending on what you would like to do with the tags.

To add a tag to a player:

To list the tags for a player:

To remove a tag from a player:

Definitions

Tag Command in Minecraft PS4 Edition

In Minecraft PS4 Edition, there are different syntaxes depending on what you would like to do with the tags.

To add a tag to a player:

To list the tags for a player:

To remove a tag from a player:

Definitions

Tag Command in Minecraft Nintendo Switch Edition

In Minecraft Nintendo Switch Edition, there are different syntaxes depending on what you would like to do with the tags.

To add a tag to a player:

To list the tags for a player:

To remove a tag from a player:

Definitions

Tag Command in Minecraft Education Edition

In Minecraft Education Edition, there are different syntaxes depending on what you would like to do with the tags.

To add a tag to a player:

To list the tags for a player:

To remove a tag from a player:

Definitions

Tag 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 tags.

To add a tag to a player:

To list the tags for a player:

To remove a tag from a player:

Definitions

Examples

Example in Java Edition (PC/Mac) 1.13, 1.14, 1.15 and 1.16

To add a tag called FoundMesaBiome to the nearest player in Minecraft 1.13, 1.14, 1.15 and 1.16:

To list the tags for all players:

To remove the tag called FoundMesaBiome from the player called DigMinecraft:

Example in Java Edition (PC/Mac) 1.8, 1.9, 1.10, 1.11 and 1.12

In Minecraft 1.12 and older, use the /scoreboard players tag to manage player tags instead of the /tags command.

Example in Pocket Edition (PE)

To add a tag called TamedHorse to the nearest player in Minecraft PE:

To list the tags for all players:

To remove the tag called TamedHorse from the player called Axe2Grind:

Example in Xbox One Edition

To add a tag called FirstKill to the nearest player in Minecraft Xbox One Edition:

To list the tags for all players:

To remove the tag called FirstKill from the player called TheEarthMover:

Example in PS4 Edition

To add a tag called FoughtDragon to the nearest player in Minecraft PS4 Edition:

To list the tags for all players:

To remove the tag called FoughtDragon from the player called DigMinecraft:

Example in Nintendo Switch Edition

To add a tag called PlantedWheat to the nearest player in Minecraft Nintendo Switch Edition:

To list the tags for all players:

To remove the tag called PlantedWheat from the player called DigMinecraft:

Example in Windows 10 Edition

To add a tag called BattledWither to the nearest player in Minecraft Windows 10 Edition:

To list the tags for all players:

To remove the tag called BattledWither from the player called TheEarthMover:

Example in Education Edition

To add a tag called UsedRedstone to the nearest player in Minecraft Education Edition:

To list the tags for all players:

To remove the tag called UsedRedstone from the player called DigMinecraft:

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 will add a tag called FoundMesaBiome to the nearest player in Minecraft Java Edition (PC/Mac) 1.13 with the following command:

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, the new tag will be added to the player.

You will see the message » Added tag ‘FoundMesaBiome’ to DigMinecraft » appear in the lower left corner of the game window to indicate that the tag was successfully add to the player named DigMinecraft.

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

Other Game Commands

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

Источник

Читайте также:  как установить эксель на виндовс 10 бесплатно и без ключа
Компьютерный онлайн портал