Nbt tags for wither boss in minecraft (java edition 1.16/1.17/1.18)

Other NBT Tags

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

NBT Tags

NBT Tags for Player

NBT Tags for Armor Stand

NBT Tags for Bat

NBT Tags for Bee

NBT Tags for Blaze

NBT Tags for Boat

NBT Tags for Cat

NBT Tags for Cave Spider

NBT Tags for Chicken

NBT Tags for Cod

NBT Tags for Cow

NBT Tags for Creeper

NBT Tags for Dolphin

NBT Tags for Donkey

NBT Tags for Drowned

NBT Tags for Elder Guardian

NBT Tags for Ender Crystal

NBT Tags for Ender Dragon

NBT Tags for Enderman

NBT Tags for Endermite

NBT Tags for Evoker

NBT Tags for Fireball

NBT Tags for Firework Rocket

NBT Tags for Fox

NBT Tags for Ghast

NBT Tags for Giant

NBT Tags for Guardian

NBT Tags for Hoglin

NBT Tags for Horse

NBT Tags for Husk

NBT Tags for Illusioner

NBT Tags for Iron Golem

NBT Tags for Llama

NBT Tags for Magma Cube

NBT Tags for Mooshroom

NBT Tags for Mule

NBT Tags for Ocelot

NBT Tags for Panda

NBT Tags for Parrot

NBT Tags for Phantom

NBT Tags for Pig

NBT Tags for Piglin

NBT Tags for Pillager

NBT Tags for Polar Bear

NBT Tags for Pufferfish

NBT Tags for Rabbit

NBT Tags for Ravager

NBT Tags for Salmon

NBT Tags for Sheep

NBT Tags for Shulker

NBT Tags for Shulker Bullet

NBT Tags for Silverfish

NBT Tags for Skeleton

NBT Tags for Skeleton Horse

NBT Tags for Slime

NBT Tags for Snow Man

NBT Tags for Spider

NBT Tags for Squid

NBT Tags for Stray

NBT Tags for Trader Llama

NBT Tags for Tropical Fish

NBT Tags for Turtle

NBT Tags for Vex

NBT Tags for Villager

NBT Tags for Vindicator

NBT Tags for Wandering Trader

NBT Tags for Witch

NBT Tags for Wither Boss

NBT Tags for Wither Skeleton

NBT Tags for Wolf

NBT Tags for Zoglin

NBT Tags for Zombie

NBT Tags for Zombie Horse

NBT Tags for Zombie Villager

NBT Tags for Zombified Piglin

Other NBT Tags

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

NBT Tags

NBT Tags for Player

NBT Tags for Armor Stand

NBT Tags for Bat

NBT Tags for Bee

NBT Tags for Blaze

NBT Tags for Boat

NBT Tags for Cat

NBT Tags for Cave Spider

NBT Tags for Chicken

NBT Tags for Cod

NBT Tags for Cow

NBT Tags for Creeper

NBT Tags for Dolphin

NBT Tags for Donkey

NBT Tags for Drowned

NBT Tags for Elder Guardian

NBT Tags for Ender Crystal

NBT Tags for Ender Dragon

NBT Tags for Enderman

NBT Tags for Endermite

NBT Tags for Evoker

NBT Tags for Fireball

NBT Tags for Firework Rocket

NBT Tags for Fox

NBT Tags for Ghast

NBT Tags for Giant

NBT Tags for Guardian

NBT Tags for Hoglin

NBT Tags for Horse

NBT Tags for Husk

NBT Tags for Illusioner

NBT Tags for Iron Golem

NBT Tags for Llama

NBT Tags for Magma Cube

NBT Tags for Mooshroom

NBT Tags for Mule

NBT Tags for Ocelot

NBT Tags for Panda

NBT Tags for Parrot

NBT Tags for Phantom

NBT Tags for Pig

NBT Tags for Piglin

NBT Tags for Pillager

NBT Tags for Polar Bear

NBT Tags for Pufferfish

NBT Tags for Rabbit

NBT Tags for Ravager

NBT Tags for Salmon

NBT Tags for Sheep

NBT Tags for Shulker

NBT Tags for Shulker Bullet

NBT Tags for Silverfish

NBT Tags for Skeleton

NBT Tags for Skeleton Horse

NBT Tags for Slime

NBT Tags for Snow Man

NBT Tags for Spider

NBT Tags for Squid

NBT Tags for Stray

NBT Tags for Strider

NBT Tags for Trader Llama

NBT Tags for Tropical Fish

NBT Tags for Turtle

NBT Tags for Vex

NBT Tags for Vindicator

NBT Tags for Wandering Trader

NBT Tags for Witch

NBT Tags for Wither Boss

NBT Tags for Wither Skeleton

NBT Tags for Wolf

NBT Tags for Zoglin

NBT Tags for Zombie

NBT Tags for Zombie Horse

NBT Tags for Zombie Villager

NBT Tags for Zombified Piglin

Minecraft: Дополнительная информация о тегах NBT

Помимо использования команды/data, игроки также могут использовать сторонние редакторы тегов NBT для изменения свойств, если они не хотят использовать синтаксис команды для выполнения работы в игре. . Некоторые игроки предпочитают это при создании определенных сущностей или объектов, особенно при создании пользовательского мира.

Тем не менее, теги NBT могут использоваться вместе с командами/give и/summon для создания пользовательских предметов или мобов, если игроки не хотят создавать сущность, а затем изменять ее.

Сущности по умолчанию входят в мир Minecraft без каких-либо прикрепленных к ним тегов, и если игроки захотят добавить их вручную, они могут выполнить следующий процесс:

  1. Наберите/tag, нацеливаясь на выбранный объект. Это может быть моб, подставка для доспехов или что-то среднее между ними.
  2. После нажатия пробела появятся селекторы целей, один из которых отображается в виде длинной строки цифр и букв. Это идентификатор целевой сущности, который следует выбрать для добавления тегов.
  3. После размещения другого места игроки могут ввести «добавить».
  4. Затем игроки могут ввести любой тег, который они придумали. Поскольку тег по своей сути является дескриптором, игроки могут использовать любой тег, какой захотят. Например, игроки могут использовать тег «Друг» и добавлять его к мобу.
  5. После ввода и успешного добавления тега сущности с меткой «Друг» теперь могут появляться при поиске с помощью таких команд, как «/say @e », которые заставят игрока перечислить любые сущности, помеченные меткой «Друг» в чате. Например, если тег «Друг» был помещен на свинью, текстовый результат команды/say вернет «Свинья».

Примерно таким же образом можно удалить теги NBT Minecraft. . Этого можно добиться с помощью того же синтаксиса, что и при добавлении тега, но с помощью команды «Удалить» вместо «Добавить» в командной строке. Редактирование также может работать таким же образом.

Теги также могут использоваться для исключения определенных сущностей в мире Minecraft. Используя предыдущий пример «Друг», игроки могут использовать команду/give, а затем использовать тег объекта «@e », чтобы исключить все, что помечено как Друг, из получения определенного предмета.

Язык сценариев имеет множество функций, которые могут использовать теги для изменения нескольких частей данного игрового мира. Игрокам может быть полезно сохранить список наиболее часто используемых документов или использовать язык сценариев в тегах или редакторах кода тегов. Это позволит им не перегружаться в игре огромным количеством доступной информации.

Изучение тегов NBT требует много времени, но для игроков Minecraft, которые могут захотеть попробовать свои силы в создании детального контента, Теги NBT — невероятно полезный инструмент, который можно применять, даже если команды, которые с ними взаимодействуют, сложны.

Игроки могут найти дополнительную информацию о тегах NBT на таких сайтах, как DigMinecraft или Minecraft Wiki, которые позволили сообществу источник всех соответствующих команд, относящихся к тегам и таргетингу, в одном месте.

Следите за Fox-Guide Minecraft на YouTube, Snapchat и Facebook, чтобы быть в курсе последних новостей и обновлений!

Output[]

Command Edition Situation Success Count
any Java Edition On fail
On success 1 1 1
a numeric tag is got 1 1 the obtained value after rounding down
a list or array tag is got 1 1 The number of elements in this list or array
a string tag is got 1 1 The length of the string
a compound tag is got 1 1 The number of tags that are direct children of that compound
On success 1 1 the obtained value multiplied by , then rounded down
On success 1 1 1
On success 1 1 1
On success 1 1 the number of lists or arrays to which new elements are added
On success 1 1 the number of target tags that was successfully modified
On success 1 1 the number of target compound tags that was successfully modified

Использование в Minecraft

Использование формата NBT в Minecraft местами является странным. В некоторых случаях пустые списки могут быть представлены списками байтов (или тегов End в более новых версиях Minecraft), а не списками правильного типа. К тому же, каждый корневой тег имеет пустое название и включает только один составной тег с самими данными и названием. Например:

  • Корневой тег для большинства структур NBT в Minecraft

     Название: Единственный тег, содержащийся в корневом теге. Он имеет название и содержит сами данные.

    .

Ещё одна заметная странность — это то, что, хотя оригинальная спецификация Нотча допускает пробелы в названиях тегов и приведённый в ней пример использует это, в Minecraft нет файлов с пробелами в тегах. Также использование прописных букв в названиях тегов непостоянно: где-то с прописной буквы пишется каждое слово, где-то — каждое, кроме первого, а где-то используются только строчные буквы.

Область применения

  • level.dat хранится в сжатом формате NBT.
  • Файлы <player>.dat хранятся в сжатом формате NBT.
  • idcounts.dat хранится в несжатом формате NBT.
  • villages.dat хранится в сжатом формате NBT.
  • Файлы map_<#>.dat хранятся в сжатом формате NBT.
  • servers.dat, используется для хранения списка сохранённых серверов как несжатый формат NBT.
  • Чанки хранятся в сжатом формате NBT в файлах областей.
  • хранится в сжатом формате NBT.
  • Натуральные структуры хранятся в сжатом формате NBT.

List of NBT Tags

Here is a list of the NBT tags that you can use for in Minecraft Java Edition (PC/Mac) 1.16, 1.17 and 1.18:

NBT Tag Value (Description) Works With
FromBucket

0 (The cod is not from a Bucket of Cod)
1 (The cod is from a Bucket of Cod)

Example
{FromBucket:0}

/summon/data
CustomName

name (The name to assign to the cod)

Example
{CustomName:»\»Fishy\»»}

/summon/data
Health

number (The number of health points the cod has)

Example
{Health:10.0f}

/summon/data
AbsorptionAmount

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

Example
{AbsorptionAmount:2.0f}

/summon/data
Invulnerable

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

Example
{Invulnerable:1}

/summon/data
PersistenceRequired

0 (The cod will despawn naturally)
1 (The cod won’t despawn)

Example
{PersistenceRequired:1}

/summon/data
NoAI

0 (The cod will have artificial intelligence and will move/behave like normal)
1 (The cod will have no artificial intelligence and will appear motionless)

Example
{NoAI:1}

/summon/data
Silent

0 (The cod will make its usual noises in the game)
1 (The cod will not make any noise in the game)

Example
{Silent:1}

/summon/data
Fire

ticks (The number of game ticks until the cod is no longer on fire — there are 20 ticks in a second)

Example
{Fire:60}

/summon/data
PortalCooldown

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

Example
{PortalCooldown:120}

/summon/data
Air

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

Example
{Air:120}

/summon/data
id

cod (The entity value used to represent a cod in the Passengers tag)

Example
{id:cod}

/summon
Passengers

The mob that is riding on the cod. Use the entity value for the passenger mob

Example of skeleton as passenger
Passengers:

/summon/data

NBT Tag Examples

To summon a cod that has no artificial intelligence:

/summon cod ~ ~ ~ {NoAI:1}

To summon a cod that is named Fishy and has no artificial intelligence:

/summon cod ~ ~ ~ {CustomName:"\"Fishy\"", NoAI:1}

Tag Basics

Structure of a Tag

First off, each tag has three parts:

(byte, 0-12)
(TAG_String)

When using commands, the is figured out based on the given , and the payload is what follows the colon — basically its value. The payload ought to fit the expected syntax. So a tag expecting an integer will not accept a string.

Number types can be denoted with a letter at the end of the value (such as for a byte). Without a letter, the code assumes an integer, which works fine for most numbers but behaves differently. Using a literal integer like this to exceed a type’s expected range simply wraps the number back to 0 at the limit.

Tag Types

TAG_End
Unnamed, no payload, unusable in commands. Used in data storage to mark the end of TAG_Compound.
TAG_Byte
Payload: A single signed byte (8 bits)
Ranges from to . Used for many booleans.
In Commands: or
TAG_Short
Payload: A single signed short integer (2 bytes, big endian)
Ranges from to
In Commands: or
TAG_Int
Payload: A single signed integer (4 bytes, big endian)
Ranges from to
In Commands: A literal number without a decimal
TAG_Long
Payload: A single signed long integer (8 bytes, big endian)
Ranges from to
In Commands: or
TAG_Float
Payload: A floating-point number (4 bytes, big endian, IEEE 754-2008, single precision)
Maxes around , or
In Commands: or , decimal or no decimal
TAG_Double
Payload: A floating-point number (8 bytes, big endian, IEEE 754-2008, double precision)
Maxes around , or
In Commands: , , or a decimal number
TAG_Byte_Array
Payload: Unnamed TAG_Int (length), then an array of bytes of unspecified format. The length of this array is bytes.
In Commands:
( is determined by the length of the given array)
TAG_String
Payload: Unnamed TAG_Short (length), then an array of bytes of length defining a string in UTF-8 format.
In Commands:
( is determined by the length of the given text)
Note that as is usual with most strings, if quotes are to be included within the string, escape codes () must be used for the inner quotes in commands.
TAG_List
Payload: Unnamed TAG_Byte (tagId), unnamed TAG_Int (length), then a sequential list of unnamed Tags of type . The length of this array is Tags.
In Commands:
( is determined by the length of the given list)
TAG_Compound
Payload: A sequential list of unique Named Tags. This array is terminated by a TAG_End.
Nested Compound Tags are terminated by their own internal End Tags.
In Commands:
(The terminating TAG_End is irrelevant to command usage)
TAG_Int_Array
Payload: Unnamed TAG_Int (size), then an array of unnamed TAG_Ints. The length of this array is Tags.
An array of integers.
In Commands:
( is determined by the size of the given array)
TAG_Long_Array
Payload: Unnamed TAG_Int (size), then an array of unnamed TAG_Longs. The length of this array is Tags.
In Commands: Used as
( is determined by the size of the given array)

History[]

The NBT file format was described by Notch in a brief specification.

The original known version was 19132 as introduced in Beta 1.3, and since then has been updated to 19133 with the Anvil file format, which adds the tag. The NBT format dates all the way back to Indev with tags 0 to 10 in use.

Java Edition
1.0.0 Notch works on «saving arbitrary data with item instances.»
1.8 14w03a NBT data now supports using string IDs rather than numerical IDs.
1.12 ? Added long array tags.
1.13 18w01a Added a data generator to both the Minecraft client and the default multiplayer software.
1.14 19w08a String tags in SNBT can now be within single quotes in addition to double quotes .

Other NBT Tags

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

NBT Tags

NBT Tags for Player

NBT Tags for Armor Stand

NBT Tags for Bat

NBT Tags for Bee

NBT Tags for Blaze

NBT Tags for Boat

NBT Tags for Cat

NBT Tags for Cave Spider

NBT Tags for Chicken

NBT Tags for Cod

NBT Tags for Cow

NBT Tags for Creeper

NBT Tags for Dolphin

NBT Tags for Donkey

NBT Tags for Drowned

NBT Tags for Elder Guardian

NBT Tags for Ender Crystal

NBT Tags for Ender Dragon

NBT Tags for Enderman

NBT Tags for Endermite

NBT Tags for Evoker

NBT Tags for Fireball

NBT Tags for Firework Rocket

NBT Tags for Fox

NBT Tags for Ghast

NBT Tags for Giant

NBT Tags for Guardian

NBT Tags for Hoglin

NBT Tags for Horse

NBT Tags for Husk

NBT Tags for Illusioner

NBT Tags for Iron Golem

NBT Tags for Llama

NBT Tags for Magma Cube

NBT Tags for Mooshroom

NBT Tags for Mule

NBT Tags for Ocelot

NBT Tags for Panda

NBT Tags for Parrot

NBT Tags for Phantom

NBT Tags for Pig

NBT Tags for Piglin

NBT Tags for Pillager

NBT Tags for Polar Bear

NBT Tags for Pufferfish

NBT Tags for Rabbit

NBT Tags for Ravager

NBT Tags for Salmon

NBT Tags for Sheep

NBT Tags for Shulker

NBT Tags for Shulker Bullet

NBT Tags for Silverfish

NBT Tags for Skeleton

NBT Tags for Skeleton Horse

NBT Tags for Slime

NBT Tags for Snow Man

NBT Tags for Spider

NBT Tags for Squid

NBT Tags for Stray

NBT Tags for Strider

NBT Tags for Trader Llama

NBT Tags for Tropical Fish

NBT Tags for Turtle

NBT Tags for Vex

NBT Tags for Villager

NBT Tags for Vindicator

NBT Tags for Wandering Trader

NBT Tags for Witch

NBT Tags for Wither Boss

NBT Tags for Wither Skeleton

NBT Tags for Wolf

NBT Tags for Zoglin

NBT Tags for Zombie Horse

NBT Tags for Zombie Villager

NBT Tags for Zombified Piglin

El como lo usan en Minecraft[]

El uso de Minecraft del formato NBT es extraño a veces. En algunos casos, las listas vacías pueden representarse como una lista de etiquetas de bytes en lugar de una lista del tipo correcto, o como una lista de etiquetas finales en las versiones más nuevas de Minecraft, lo que puede romper algunas herramientas NBT más antiguas. Además, casi todas las etiquetas raíz tienen una cadena de nombre vacía y encapsulan solo una etiqueta compuesta con los datos reales y un nombre. Por ejemplo:

  •  SomeName: La única etiqueta contenida dentro de la etiqueta raíz: tiene un nombre y contiene todos los datos reales.

    La etiqueta raíz para la mayoría de las estructuras NBT en Minecraft.

Otra rareza notable es que, aunque la especificación original de Notch permite espacios en los nombres de las etiquetas, e incluso el ejemplo usa espacios en los nombres de las etiquetas, Minecraft no tiene archivos conocidos en los que las etiquetas tengan espacios en sus nombres. También hay un uso inconsistente de mayúsculas y minúsculas, principalmente camelCase o PascalCase, pero a veces incluso en minúsculas.

Uses

  • level.dat se almacena en formato comprimido NBT.
  • <player>.dat Los archivos se almacenan en formato comprimido NBT.
  • idcounts.dat se almacena en formato NBT sin comprimir.
  • villages.dat se almacena en formato NBT comprimido.
  • map_<#>.dat Los archivos se almacenan en formato comprimido NBT.
  • servers.dat, se utiliza para almacenar la lista de servidores multijugador guardados como NBT sin comprimir.
  • Chunks se almacenan en formato NBT comprimido dentro de los archivos Region.
  • se almacena en formato NBT comprimido.
  • Generated structures se almacena en formato NBT comprimido.
  • Saved structures se almacena en formato NBT comprimido.

Examples[]

  • To get the saturation level of the current player:
  • To make the nearest item within 10 blocks unable to be picked up by players:
  • To get the Y-position of a random item:
  • To get the item ID of the item in the first hotbar slot of the nearest player:
  • To set the armor attribute of the dolphin closest to coordinates (0, 64, 0) to 20:
  • To change the first item in a chest located at coordinates (1, 64, 1) into a diamond block, keeping all NBT data:
  • To make the nearest zombie have a 80% chance to drop items in its left hand when it dies, and never drop that in the main hand:
  • To make the nearest zombie have a 80% chance to drop items in its left hand when it dies, and never drop that in its main hand, without affecting the chance for main hand:

Other NBT Tags

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

NBT Tags

NBT Tags for Player

NBT Tags for Armor Stand

NBT Tags for Bat

NBT Tags for Bee

NBT Tags for Blaze

NBT Tags for Boat

NBT Tags for Cat

NBT Tags for Cave Spider

NBT Tags for Chicken

NBT Tags for Cod

NBT Tags for Cow

NBT Tags for Creeper

NBT Tags for Dolphin

NBT Tags for Donkey

NBT Tags for Drowned

NBT Tags for Elder Guardian

NBT Tags for Ender Crystal

NBT Tags for Ender Dragon

NBT Tags for Enderman

NBT Tags for Endermite

NBT Tags for Evoker

NBT Tags for Fireball

NBT Tags for Firework Rocket

NBT Tags for Fox

NBT Tags for Ghast

NBT Tags for Giant

NBT Tags for Guardian

NBT Tags for Hoglin

NBT Tags for Horse

NBT Tags for Husk

NBT Tags for Illusioner

NBT Tags for Iron Golem

NBT Tags for Llama

NBT Tags for Magma Cube

NBT Tags for Mooshroom

NBT Tags for Mule

NBT Tags for Ocelot

NBT Tags for Panda

NBT Tags for Parrot

NBT Tags for Phantom

NBT Tags for Pig

NBT Tags for Piglin

NBT Tags for Pillager

NBT Tags for Polar Bear

NBT Tags for Pufferfish

NBT Tags for Rabbit

NBT Tags for Ravager

NBT Tags for Salmon

NBT Tags for Sheep

NBT Tags for Shulker

NBT Tags for Shulker Bullet

NBT Tags for Silverfish

NBT Tags for Skeleton

NBT Tags for Skeleton Horse

NBT Tags for Slime

NBT Tags for Snow Man

NBT Tags for Spider

NBT Tags for Squid

NBT Tags for Stray

NBT Tags for Strider

NBT Tags for Trader Llama

NBT Tags for Tropical Fish

NBT Tags for Turtle

NBT Tags for Vex

NBT Tags for Villager

NBT Tags for Vindicator

NBT Tags for Wandering Trader

NBT Tags for Witch

NBT Tags for Wither Boss

NBT Tags for Wither Skeleton

NBT Tags for Zoglin

NBT Tags for Zombie

NBT Tags for Zombie Horse

NBT Tags for Zombie Villager

NBT Tags for Zombified Piglin

Tag Payloads

The payload is the data a Tag carries. It might be a number or, in the case of Compound Tags and List Tags, other Tags. In using commands, one simply needs to avoid mismatching expected data types, keep values within expected ranges, and close all brackets and braces that are opened.

For a deeper understanding of payloads, it might help to look at what an example Compound Tag would look like in data.

ON DISK: 00001010 00000000 00000011 01101000 01100001 01101101 00001000 00000000 00000111 01110000 01101001 01100111 01001110 01100001 01101101 01100101 00000000 00000110 01001000 01100001 01101101 01110000 01110101 01110011 00000011 00000000 00000101 01110110 01100001 01101100 01110101 01100101 00000000 00000000 00000000 01111000 00000000
    DEC: 10       0        3        h        a        m        8        0        7        p        i        g        N        a        m        e        0        6        H        a        m        p        u        s        3        0        5        v        a        l        u        e        0        0        0        120      0

       __ ___ _____ _ ___ _____________ ___ ___________ _ ___ _________ _________ _
BYTES: 10 0 3 h a m 8 0 7 p i g N a m e 0 6 H a m p u s 3 0 5 v a l u e 0 0 0 120 0
                   |8: TAG_String      |  payload      |3: TAG_Int     | payload | TAG_End |
    10:TAG_Compound|                                payload                                |

This is understood in the following way. Recall that all named tags have a (1 byte), a (Unnamed TAG_String), and a payload.

  • The first byte of data read is the . Above is , so this represents a TAG_Compound. The next two bytes read are the length of its name. (Two bytes because it expects a short — see above.) The given length is . Those next 3 bytes read . So far it’s been revealed that the first Tag is a Compound Tag named «ham». Its payload is everything that follows, until TAG_End.
    • The next byte is , so this is a TAG_String. The upcoming unnamed TAG_String tells us it has the 7-byte name of «pigName». Its payload follows.
    • The next byte is , so next is a TAG_Int. It has the 5-byte name of «value». Its payload follows in the next 4 bytes: . The next completed Tag is
    • The next byte is , so next is a TAG_End.

The completed Compound Tag is as follows:

TAG_Compound("ham"):
   TAG_String("pigname"): 6 Hampus,
   TAG_Int("value"): 120,
   TAG_End

Using a command to summon a pig with this example tag would look like this:

/summon minecraft:pig ~ ~ ~ {ham:{pigname:"Hampus",value:120}}

Official software[]

See also: Tutorials/Running the Data Generator

Mojang has provided sample Java NBT classes for developers to use and reference as part of the source code for the MCRegion to Anvil file format converter. Since Java Edition 1.13, Minecraft includes a built-in converter between the SNBT format and compressed NBT format, which comes with both the client and official server.

The data generator from Minecraft is able to convert uncompressed Stringified NBT files with .snbt extension in an input folder to GZip compressed NBT format files with .nbt extension in an output folder, and vice versa.

The vanilla data generator can convert any GZip compressed NBT format to SNBT format. The file extension of a file can simply be changed, such as level.dat to level.nbt and put in the input folder, and the generator then decodes the GZip compressed NBT data.

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). The name of tags may contain spaces, although Minecraft itself never saves tags with spaces in the names. 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:

ID Icon Tag Type Payload SNBT Format[Java edition only] Description Storage Capacity
TAG_End None. Used to mark the end of compound tags. This tag does not have a name, so it is only ever a single byte 0. It may also be the type of empty List tags. N/A
1 TAG_Byte 1 byte / 8 bits, signed or A signed integral type. Sometimes used for booleans. Full range of -(27) to (27 — 1)(-128 to 127)
2 TAG_Short 2 bytes / 16 bits, signed, big endian or A signed integral type. Full range of -(215) to (215 — 1)(-32,768 to 32,767)
3 TAG_Int 4 bytes / 32 bits, signed, big endian A signed integral type. Full range of -(231) to (231 — 1)(-2,147,483,648 to 2,147,483,647)
4 TAG_Long 8 bytes / 64 bits, signed, big endian or A signed integral type. Full range of -(263) to (263 — 1)(-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807)
5 TAG_Float 4 bytes / 32 bits, signed, big endian, IEEE 754-2008, binary32 or A signed floating point type. Precision varies throughout number line;See Single-precision floating-point format. Maximum value about 3.4*1038
6 TAG_Double 8 bytes / 64 bits, signed, big endian, IEEE 754-2008, binary64 , or A signed floating point type. Precision varies throughout number line;See Double-precision floating-point format. Maximum value about 1.8*10308
7 TAG_Byte_Array TAG_Int’s payload size, then size TAG_Byte’s payloads. An array of bytes. Maximum number of elements ranges between (231 — 9) and (231 — 1) (2,147,483,639 and 2,147,483,647), depending on the specific JVM.
8 TAG_String A TAG_Short-like, but instead unsigned payload length, then a UTF-8 string resembled by length bytes. , (Πρότυπο:Cd within needs to be escaped to Πρότυπο:Cd), or (Πρότυπο:Cd within needs to be escaped to Πρότυπο:Cd) A UTF-8 string. It has a size, rather than being null terminated. 65,535 bytes interpretable as UTF-8 (see ; most commonly-used characters are a single byte).
9 TAG_List TAG_Byte’s payload tagId, then TAG_Int’s payload size, then size tags’ payloads, all of type tagId. A list of tag payloads, without repeated tag IDs or any tag names. Due to JVM limitations and the implementation of ArrayList, the maximum number of list elements is (231 — 9), or 2,147,483,639. Also note that List and Compound tags may not be nested beyond a depth of 512.
10 TAG_Compound Fully formed tags, followed by a TAG_End. A list of fully formed tags, including their IDs, names, and payloads. No two tags may have the same name. Unlike lists, there is no hard limit to the number of tags within a Compound (of course, there is always the implicit limit of virtual memory). Note, however, that Compound and List tags may not be nested beyond a depth of 512.
11 TAG_Int_Array TAG_Int’s payload size, then size TAG_Int’s payloads. An array of TAG_Int’s payloads. Maximum number of elements ranges between (231 — 9) and (231 — 1) (2,147,483,639 and 2,147,483,647), depending on the specific JVM.
12 TAG_Long_Array TAG_Int’s payload size, then size TAG_Long’s payloads. An array of TAG_Long’s payloads. Maximum number of elements ranges between (231 — 9) and (231 — 1) (2,147,483,639 and 2,147,483,647), depending on the specific JVM.

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.

Array-Sortierung[]

Oft enthält ein Array die Werte einer Fläche oder eines Raumes der Minecraft-Welt. Die Angabe zur Sortierung der Array-Daten ist entscheidend, um die korrekte Position eines Blockes im Array zu finden. Bei Flächen ist die Sortierung meistens XZ. Das bedeutet, dass erst alle X-Werte für Z=0 aufgeführt sind, gefolgt von allen X-Werten für Z=1 etc. Beispiel: die Position X=4 / Z=7 befindet sich in einem 16×16-XZ-Array an Position 7×16+4 = 116.

Die seltenere ZX-Sortierung bedeutet, dass erst alle Z-Werte für X=0 aufgeführt sind, gefolgt von allen Z-Werten für X=1 etc. Beispiel: die Position X=4 / Z=7 befindet sich in einem 16×16-ZX-Array an Position 4×16+7 = 71.

Chunk-Sektionen werden in einem Array in XZY-Sortierung abgelegt. Das bedeutet, dass erst alle XZ-Flächen für Y=0 aufgeführt sind, gefolgt von allen XZ-Flächen für Y=1 etc. Beispiel: die Position X=4 / Y=5 / Z=7 befindet sich in einem 16×16×16-XZY-Array an Position 5×256+7×16+4 = 1396.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Adblock
detector