Nbt tags

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

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:

NBT Tag Value (Description) Works With
IsBaby

0 (The zombie will be a full grown adult zombie)
1 (The zombie will be a baby zombie)

Example
{IsBaby:1}

/summon/data
CanPickUpLoot

0 (The zombie can not pick up loot off the ground)
1 (The zombie can pick up loot off the ground)

Example
{CanPickUpLoot:0}

/summon/data
CanBreakDoors

0 (The zombie can not break down wooden doors or iron doors)
1 (The zombie can break down wooden doors but still can not break down iron doors)

Example
{CanBreakDoors:0}

/summon/data
LeftHanded

0 (The zombie is right-handed)
1 (The zombie is left-handed)

Example
{LeftHanded:1}

/summon/data
CustomName

name (The name to assign to the zombie)

Example
{CustomName:»\»Killer\»»}

/summon/data
Health

number (The number of health points the zombie has)

Example
{Health:25.0f}

/summon/data
AbsorptionAmount

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

Example
{AbsorptionAmount:2.0f}

/summon/data
Invulnerable

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

Example
{Invulnerable:1}

/summon/data
PersistenceRequired

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

Example
{PersistenceRequired:1}

/summon/data
NoAI

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

Example
{NoAI:1}

/summon/data
Silent

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

Example
{Silent:1}

/summon/data
Fire

ticks (The number of game ticks until the zombie 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 zombie 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 zombie has air left for)

Example
{Air:120}

/summon/data
HandItems

Items that the zombie is holding in its hands, listed in this order: right hand, left hand

Syntax
HandItems:

Example
{HandItems:}

/summon/data
HandDropChances

The drop chances for each of the 2 items listed in HandItems. A value of 1.0f means 100% chance of the item being dropped when the zombie is killed, 0.5f means 50%, 0.2f means 20%, and so on.

Example
{HandDropChances:}

/summon/data
ArmorItems

Items of armor that the zombie is wearing, listed in this order: boots, leggings, chestplate, helmet

Syntax
ArmorItems:

Example
{ArmorItems:}

/summon/data
ArmorDropChances

The drop chances for each of the 4 items listed in ArmorItems. A value of 1.0f means 100% chance of the item being dropped when the zombie is killed, 0.5f means 50%, 0.2f means 20%, and so on.

Example
{ArmorDropChances:}

/summon/data
id

zombie (The entity value used to represent a zombie in the EntityTag or Passengers tag)

Example
{id:zombie}

/summon/give
Passengers

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

Example of skeleton as passenger
Passengers:

/summon/data

NBT Tag Examples

To summon a zombie that is named Braineater:

/summon zombie ~ ~ ~ {CustomName:"\"Braineater\""}

To summon a baby zombie:

/summon zombie ~ ~ ~ {IsBaby:1}

To summon a zombie that is named «The Killer» who is wearing a set of full netherite armor:

/summon zombie ~ ~1 ~ {CustomName:"\"The Killer\"", ArmorItems:, ArmorDropChances:}

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:

NBT Tag Value (Description) Works With
Owner

name (The player that owns the wolf. When you set this tag, the Owner tag will automatically be populated with the appropriate UUID value for the player.)

Example
{Owner:DigMinecraft}

/summon/data
CollarColor

0 (The collar is white)
1 (The collar is orange)
2 (The collar is magenta)
3 (The collar is light blue)
4 (The collar is yellow)
5 (The collar is lime)
6 (The collar is pink)
7 (The collar is gray)

8 (The collar is light gray)
9 (The collar is cyan)
10 (The collar is purple)
11 (The collar is blue)
12 (The collar is brown)
13 (The collar is green)
14 (The collar is red)
15 (The collar is black)

Example
{CollarColor:4}

/summon/data
Sitting

0 (The wolf is standing)
1 (The wolf is sitting)

Example
{Sitting:1}

/summon/data
InLove

ticks (The number of game ticks that the wolf is in love mode and will try to breed with another wolf)

Example
{InLove:400}

/summon/data
Age

ticks (The age of the wolf in game ticks. Use 0 or higher for an adult. Use a negative number such as -25000 for a baby.)

Example
{Age:0} example for adult
{Age:-25000} example for baby

/summon/data
ForcedAge

ticks (When a baby wolf matures, the Age data tag will be set to ForcedAged. However, there have been bugs with this data tag so it may not work properly.)

Example
{ForcedAge:0}

/summon/data
Leash

Indicates the coordinates of the fence that the wolf is leashed to.

Example
{Leash:{X:92,Y:72,Z:-206}}

/summon/data
CustomName

name (The name to assign to the wolf)

Example
{CustomName:»\»Buddy\»»}

/summon/data
Health

number (The number of health points the wolf has)

Example
{Health:25.0f}

/summon/data
AbsorptionAmount

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

Example
{AbsorptionAmount:2.0f}

/summon/data
Invulnerable

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

Example
{Invulnerable:1}

/summon/data
PersistenceRequired

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

Example
{PersistenceRequired:1}

/summon/data
NoAI

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

Example
{NoAI:1}

/summon/data
Silent

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

Example
{Silent:1}

/summon/data
Fire

ticks (The number of game ticks until the wolf 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 wolf 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 wolf has air left for)

Example
{Air:120}

/summon/data
id

wolf (The entity value used to represent a wolf in the EntityTag or Passengers tag)

Example
{id:wolf}

/summon/give
Passengers

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

Example of skeleton as passenger
Passengers:

/summon/data

NBT Tag Examples

To summon a wolf that is tamed, owned by DigMinecraft and has a blue collar:

/summon wolf ~ ~ ~ {Owner:DigMinecraft, CollarColor:11}

To summon a baby wolf named Buddy:

/summon wolf ~ ~ ~ {CustomName:"\"Buddy\"", Age:-25000}

Uso

Minecraft às vezes usa o formato NBT de maneira inconsistente; em alguns casos, listas vazias pode ser representadas como uma lista de tags Byte ao invés de uma lista do tipo correto, ou como uma lista de tags End em versões mais recentes do Minecraft, o que pode quebrar algumas ferramentas para manipulação de NBT mais antigas. Além disso, quase todas as tags raízes têm uma string de nome vazia, e encapsula uma única tag Compound com os verdadeiros dados e um nome. Por exemplo:

  •  AlgumNome:A única tag contida dentro da tag raiz — ela tem um nome e contém todos os dados reais.

    A tag raíz para a maioria das estruturas NBT do Minecraft.

Adicionalmente, embora a especificação original por Notch permite espaços em nomes de tags, e até mesmo o exemplo dado nessa especificação usa espaços nos nomes das tags, Minecraft não tem arquivos conhecidos, onde uma tag sequer possui espaços em seu nome. Há também o uso inconsistente de letras maiúsculas e minúsculas, na maioria das vezes ou CamelCase ou PascalCase, mas em alguns casos, até tudo em minúsculo.

Usos

  • level.dat é armazenado em formato NBT compactado.
  • <player>.dat é armazenado em formato NBT compactado.
  • idcounts.dat é armazenado em formato NBT compactado.
  • villages.dat é armazenado em formato NBT compactado.
  • map_<#>.dat é armazenado em formato NBT compactado.
  • servers.dat, que é usado para salvar a lista de servidores multiplayers em formato NBT descompactado.
  • Chunks são armazenadas em formato NBT comprimido dentro de arquivos Region.
  • scoreboard.dat é armazenado em formato NBT compactado.
  • Estruturas geradas são armazenadas em formato NBT compactado.

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}}

To Be Removed

The rest of this page is likely to be removed.

Blocks («» or «»)

Containers

Items: []The ID and other info of an item.

|_ id: {}The ID of the item.

|_ Slot: {}The slot number. Note that this starts at 0, not 1.

|_ tag: {}Other info of the item.

Items ()

All Items

Enchantments: Enchantments on the item.

|_ An enchantement. (List)

       |_ id: The name of the enchantment. Cannot be a number.
       |_ lvl: The level of the enchant. Range is -32768 to 32767.

display: Display properties.

|_ Name: The Custom Name of the item. Range of characters that can be used seems to be infinite.

       |_ Name: ["{\"text\":\"enter custom name here\"}"]

|_ color: The Custom Color of Leather Armor.

|_ Lore: The description of an item. Separate lines of text with a comma after the bracket, prior to the last quotation mark

       |_ Lore: ["{\"text\":\"a line of text\"}"]

Potions

CustomPotionEffects: Custom effects that a potion will have.

|_ A potion effect.

       |_ Id: The ID of the effect.
       |_ Duration: The duration of the potion effect.
       |_ Amplifier: The potency (+1) of the effect. Kept at 0 to keep a level 1 effect.
       |_ Ambient: (0/1) 0 is false, 1 is true. True if the effect is provided
by a beacon and thus should be less intrusive on screen.

Written Book

author: The author of the book.

title: The title of the book.

pages: The pages in the book.

|_ A page. Separate pages with a comma.

Tools

Unbreakable: (0b/1b) 0b is false, 1b is true. If value is 1b, the tool will never lose durability.

CanDestroy: What blocks this tool can destroy when in adventure mode.

        |_ A block ID.

CanPlaceOn: What blocks can be placed on in adventure mode.

        |_ A block ID.

Title and Tellraw

: (PlayerName) {text:»PutTextHere»,color:»PutColorHere»},(Optional){text:»MoreTextHere»,color»PutColorHere»} (Add [] to enclose if doing multiple text tags)

Поведение

Гаст бесцельно летает по Нижнему миру с закрытыми глазами и ртом и периодически издаёт звуки, похожие на стон, или плач, открывает глаза и рот, заметив игрока. Он издаёт громкий визг при атаке игрока, и громко кричит, когда получает урон. Звуки, издаваемые гастом, имеют минимальную интенсивность независимо от расстояния, это означает, что гаст может быть ближе, чем кажется. Он имеет размер 4×4×4 блока, а также 9 щупалец размером чуть длиннее, но тоньше игрока. Щупальца не являются частью хитбокса гаста.

Гасты обладают диапазоном видения в 100 блоков, обладает взрывающей атакой и высокой мобильностью. В отличие от большинства других агрессивных мобов, у гаста нет режима преследования — он не пытается приблизиться к игроку на большом расстоянии. Гасты могут заставить других мобов атаковать его, однако сам он никогда не атакует их; он нацелен только на игрока.‌[только для Java Edition] Когда игрок подходит к гасту на расстояние 16 блоков, он начинает атаковать, периодически обстреливая свою цель, и пытается набрать высоту. Гаст улетает, если его атаковать в режиме Творчества.

Гасту нужно прямо видеть игрока для начала атаки. Любые твёрдые блоки, включая прозрачные блоки, могут помешать гасту увидеть его.

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

Tag Payloads[edit | edit source]

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}}

Определение тега

Тег — отдельный элемент дерева данных. Первый байт в теге — это тип тега (также называемый идентификатором или ID), затем 2 байта хранят длину названия, затем название в виде строки в формате UTF-8 (следует отметить, что TAG_End не имеет названия и не включает дополнительные 2 байта; предполагается, что название пустое). Названия тегов могут содержать пробелы, хотя сам Minecraft не имеет таких тегов. Наконец, следующие байты — содержимое тега, зависящее от типа тега. Таблица ниже описывает 12 известных тегов в версии NBT 19133:

ID Иконка Тип тега Содержимое Описание Ёмкость
TAG_End Нет. Используется для обозначения конца составных тегов. У этого тега нет названия, поэтому он всегда представлен одним байтом, равным 0. Также этот тип используется в пустых тегах списков.
1 TAG_Byte 1 байт / 8 битов, со знаком Целочисленный тип со знаком. Иногда используется для логических переменных. Весь промежуток от -(27) до (27 — 1)(от -128 до 127)
2 TAG_Short 2 байта / 16 битов, со знаком, обратный порядок байтов Целочисленный тип со знаком. Весь промежуток от -(215) до (215 — 1)(от -32 768 до 32 767)
3 TAG_Int 4 байта / 32 бита, со знаком, обратный порядок байтов Целочисленный тип со знаком. Весь промежуток от -(231) до (231 — 1)(от -2 147 483 648 до 2 147 483 647)
4 TAG_Long 8 байт / 64 бита, со знаком, обратный порядок байтов. Целочисленный тип со знаком. Весь промежуток от -(263) до (263 — 1)(от -9 223 372 036 854 775 808 до 9 223 372 036 854 775 807)
5 TAG_Float 4 байта / 32 бита, со знаком, обратный порядок байтов, IEEE 754-2008, binary32 Тип чисел с плавающей точкой со знаком. Точность меняется на протяжении числовой прямой;см. .
6 TAG_Double 8 байт / 64 бита, со знаком, обратный порядок байтов, IEEE 754-2008, binary64 Тип чисел с плавающей точкой со знаком. Точность меняется на протяжении числовой прямой;см. .
7 TAG_Byte_Array Один TAG_Int, обозначающий размер, затем размер тегов TAG_Byte. Массив байтовых переменных. Максимальное число элементов изменяется от (231 — 9) до (231 — 1) (от 2 147 483 639 до 2 147 483 647) и зависит от текущей JVM.
8 TAG_String Один TAG_Short, обозначающий длину, затем строка в формате UTF-8 с размером длина. Строка в формате UTF-8. Она имеет размер, а не завершается нулём. 32 767 точек кода UTF-8 (см. ; наиболее распространённые символы состоят из одной точки кода.
9 TAG_List Один TAG_Byte, обозначающий тип, затем TAG_Int, обозначающий размер, затем размер тегов типа тип. Последовательный список тегов без ID и без названий. В связи с ограничениями JVM и реализацией ArrayList, максимальный размер списка — (231 — 9) или 2 147 483 639. Также следует отметить, что максимальная глубина размещения списков и составных тегов равна 512.
10 TAG_Compound Полные теги, затем один тег TAG_End. Список полных тегов, включающий их типы, названия и содержимые. Все теги должны иметь различные имена. В отличие от списков, ограничения на количество тегов в составном теге нет (хотя имеется неявное ограничение в виде размера виртуальной памяти). Также следует отметить, что максимальная глубина размещения списков и составных тегов равна 512.
11 TAG_Int_Array Один TAG_Int, обозначающий размер, затем размер тегов TAG_Int. Массив тегов TAG_Int. Максимальное число элементов изменяется от (231 — 9) до (231 — 1) (от 2 147 483 639 до 2 147 483 647) и зависит от текущей JVM.
12 TAG_Long_Array Одно значение TAG_Int (без заголовка), обозначающий размер, затем набор тегов TAG_Long. Массив тегов TAG_Long. Максимальное число элементов изменяется от (231 — 9) до (231 — 1) (от 2 147 483 639 до 2 147 483 647) и зависит от текущей JVM.

Списки и составные теги могут быть вложены. Следует отметить, что в списке списков подсписки могут иметь разные типы элементов.

Result[]

Command Trigger Java Edition
any the arguments are not specified correctly Unparseable
is unloaded or out of the world Failed
the block at is not a block entity
(in mode) fails to resolve to an entity (named player must be online)
more than one tag is got
does not exist
the obtained tag is not a numeric tag
nothing is changed
try to edit player’s data
is the root compound tag
is unloaded or out of the world
the block at is not a block entity
fails to resolve to an entity (named player must be online)
does not exist
the target tag isn’t a list or array
source data isn’t of an item type appropriate for the list
the index is invalid
the target path does not specify a compound tag
the source data is not a compound tag
any On success Get, merge, modify, and remove NBT data.

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

Programas oficiais

Veja também: Tutorials/Running the Data Generator

A Mojang providenciou amostras de classes NBT Java para os desenvolvedores usarem e referenciarem como parte do código fonte do conversor de [./http://minecraft.gamepedia.com/MCRegion MCRegion] para [./http://minecraft.gamepedia.com/Anvil_file_format Anvil file format]. Desde a [./http://minecraft.gamepedia.com/Java_Edition_1.13 Versão 1.13 da Edição Java], Minecraft inclui um conversor embutido entre o formato SNBT e o formato NBT comprimido, que vem tanto com o [./http://minecraft.gamepedia.com/Client.jar cliente] quanto com o servidor oficial.

O gerador de dados do Minecraft é capaz de converter arquivos SNBT descomprimidos com a extensão.snbt em uma pasta de entrada para arquivos no formato NBT comprimido com GZip, com extensão .nbt em uma pasta de saída, e vice-versa.

O gerador de dados vanilla consegue converter o formato NBT comprimido com GZip para o formato SNBT. A extensão de um arquivo pode simplesmente ser trocada, como em level.dat para level.nbt, e o arquivo colocado na pasta de entrada, que o gerador irá decodificar os dados NBT comprimidos com GZip.

Unbreakable items

  1. Click on the compound to select it. (it turns blue)
  2. Click on the Byte Tag button on the top bar to add a new tag.
  3. Enter in the first field and in the second. Then press Enter to submit, and save.
  4. In game, your item will be unbreakable! Just note that it won’t display anything, but the tag still takes effect.

Here is an example of a finished product:
(I did forget to include a multi-line name but you can guess what that looks like)

What Else?


When it comes to modifying things you can easily just change the value! This can be done with most of the properties, try changing the count or damage value.

How to replicate items

  • You can have a command block the chest, so that way you have infinite amounts. You can use a clever trick to be able to give them to players.
  • If you are more experienced with NBT editors, you can have villagers trade them!

SNBT format[]

This feature is exclusive to Java Edition. 

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.

Example:

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

Data Tags Value Types
Type Description Format Example
 Byte A signed 8-bit integer, ranging from -128 to 127 (inclusive). or ,
 Short A signed 16-bit integer, ranging from -32,768 to 32,767 (inclusive). or ,
 Int A signed 32-bit integer, ranging from -2,147,483,648 and 2,147,483,647 (inclusive).
 Long A signed 64-bit integer, ranging from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (inclusive). or
 Float A 32-bit, single-precision floating-point number, ranging from -3.4E+38 to +3.4E+38.

See IEEE floating point for details.

or
 Double A 64-bit, double-precision floating-point, ranging from -1.7E+308 to +1.7E+308.

See IEEE floating point for details.

, or
 String A sequence of characters, enclosed in quotes. For strings without commas, brackets, braces or spaces, quote enclosure is optional. Quotes can be either single quote or double . Nested quotes can be included within a string by escaping the character with a escape. , ( within needs to be escaped to ), or ( within needs to be escaped to )
 List An ordered list of tags, enclosed in square brackets and delimited by commas. The tags must be of the same type, determined by the first tag in the list.
 Compound An ordered list of attribute-value pairs, enclosed in curly braces and delimited by commas.

Each tag can be of any type.

 Byte Array followed by an ordered list of 8-bit integers, delimited by commas. Tag is enclosed in square brackets.
 Int Array followed by an ordered list of 32-bit integers, delimited by commas. Tag is enclosed in square brackets.
 Long Array followed by an ordered list of 64-bit integers, delimited by commas. Tag is enclosed in square brackets.
 Boolean A value, expressed as , . It is resolved by the game into a  Byte tag as 0b (for false) and 1b (for true). , or ,

To Be Removed[edit | edit source]

The rest of this page is likely to be removed.

Blocks («» or «»)edit | edit source

Containersedit | edit source

Items: []The ID and other info of an item.

|_ id: {}The ID of the item.

|_ Slot: {}The slot number. Note that this starts at 0, not 1.

|_ tag: {}Other info of the item.

Items ()edit | edit source

All Itemsedit | edit source

Enchantments: Enchantments on the item.

|_ An enchantement. (List)

       |_ id: The name of the enchantment. Cannot be a number.
       |_ lvl: The level of the enchant. Range is -32768 to 32767.

display: Display properties.

|_ Name: The Custom Name of the item. Range of characters that can be used seems to be infinite.

       |_ Name: ["{\"text\":\"enter custom name here\"}"]

|_ color: The Custom Color of Leather Armor.

|_ Lore: The description of an item. Separate lines of text with a comma after the bracket, prior to the last quotation mark

       |_ Lore: ["{\"text\":\"a line of text\"}"]

Potionsedit | edit source

CustomPotionEffects: Custom effects that a potion will have.

|_ A potion effect.

       |_ Id: The ID of the effect.
       |_ Duration: The duration of the potion effect.
       |_ Amplifier: The potency (+1) of the effect. Kept at 0 to keep a level 1 effect.
       |_ Ambient: (0/1) 0 is false, 1 is true. True if the effect is provided
by a beacon and thus should be less intrusive on screen.

Written Bookedit | edit source

author: The author of the book.

title: The title of the book.

pages: The pages in the book.

|_ A page. Separate pages with a comma.

Toolsedit | edit source

Unbreakable: (0b/1b) 0b is false, 1b is true. If value is 1b, the tool will never lose durability.

CanDestroy: What blocks this tool can destroy when in adventure mode.

        |_ A block ID.

CanPlaceOn: What blocks can be placed on in adventure mode.

        |_ A block ID.

Title and Tellrawedit | edit source

: (PlayerName) {text:»PutTextHere»,color:»PutColorHere»},(Optional){text:»MoreTextHere»,color»PutColorHere»} (Add [] to enclose if doing multiple text tags)

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

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

Adblock
detector