Что такое nbt в майнкрафт

Обновлено: 05.07.2024

Из-за новой политики Microsoft в отношении сторонних ресурсов, Minecraft Wiki больше не является официальной. В связи с этим были внесены некоторые изменения, в том числе и обновлён логотип вики-проекта. Подробности на нашем Discord-сервере.

Содержание

Формат файлов Minecraft (NBT)

Это формат файлов использовался начиная из версии indev 0.31.

Хотя для хранения уровней в Alpha и Infdev используются NBT-файлы, формат хранения данных у них все равно разный.

Чтобы прочитать больше информации про формат бесконечной карты, смотрите Alpha (формат карты).

Освещение [ ]

Lighting values.jpg

Существует 16 уровней света для блоков от 0x0 (полностью тёмный) до 0xF (максимально светлый).

Minecraft Wiki

The Minecraft Wiki is no longer considered as official by Microsoft and therefore several changes are required to be made, including to the wiki's logo. Please read this announcement for more information.

Contents

Blocks [ ]

Tagname Description Value Type Syntax
Command Used with command blocks. Places command block with command. A string

Note: This is also used for Command Block Minecarts

Generic [ ]

These tags can be used on most tile entitied blocks

Tagname Description Value Type Syntax
CustomName Displayed in the top left corner of the inventory, instead of the regular name. Works only where such a regular name exists. A JSON text component
Lock Says a name needed on a held item to open the inventory. A string

Beacon [ ]

Tagname Description Value Type Syntax
Primary This determines the first status effect that the beacon creates. It defaults to level 1 of the effect. An ID of a status effect.
Secondary This determines the second status effect. If its the same as Primary, then it increases the status effect to level 2. Otherwise it is level 1. Also an ID of a status effect.
Levels This number determines how many layers of valid blocks are below the beacon. This value updates automatically, and overrides /data inputs immediately. Integer

Spawner [ ]

These tags are used when using /setblock or /summon (spawner minecarts) to create spawners. Add only those data tags you want to avoid a potential error.

Данные [ ]

Массив данных также используется для эмуляции освещения, а также для хранения другой дополнительной информации относительно блоков. Первые 4 бита содержат дополнительную информацию про блоки и остальные 4 для освещения.

Дополнительные данные используют следующие блоки:

Грядка [ ]

0x0 значит сухое состояние, 0x1 указывает на то, что грядка увлажненная. Показатель увлажнения зависит от того, насколько далеко грядка расположена от воды.

Семена [ ]

Семена вырастают начиная из значения 0x0 и заканчивая 0x7.

Crop states.jpg

Факела [ ]

Факелы используют дополнительные данные для определения их положения.

0x0 значит, что факел установлен вертикально на горизонтальную поверхность. Значения от 0x1 до 0x4 указывают на то, что факел «прилеплен» к одной из вертикальных граней блока.

Torches2.jpg

Tutorials/Command NBT tags

Please update this page to reflect recent updates or newly available information.

NBT tags can be specified for items and entities created with the /give and /summon commands. Each tag has the format <tagname>:<value>; where <tagname> describes what it does and <value> is how much it applies. Multiple tags are separated by commas. (e.g.: ],display:<>> ). The contents of List tags are enclosed in square brackets [] , while the contents of Compound tags are enclosed in curly brackets <> – note that the entire data tag is itself a Compound tag (All within a set of <> ). Tag names are case-sensitive, and white space is ignored. additionally, some tags are either true or false (Example: )

The player can quickly find data tags (NBT) without the use of external editors by using /data to figure out the data for each entity or block entity. See more about this in the article Commands/data.

See Entity format for the various NBT Tags that are saved for each entity. This page also contains basic information for each NBT Tag.

When None is used in a tag name that means that this tag can be put directly into the start of the dataTag.

Entities [ ]

These tags are used when using the /summon command to spawn entities or when using the /data to edit the data of entities.

This tag determines only the entity's velocity, not the direction that it's facing.

The following table provides information on each tagname that can be added in an NBT Tag. These tagnames are specific to the /summon command.

Villager [ ]

These tags are used when summoning villagers. (Offers NBT can't be done in 1.14+)

Item Frame [ ]

These tags are used when summoning itemframes.

Tag name Description Value type Syntax
Facing Determines the direction of the item frame Numerical, 0 - 5 (0 up; 1 down; 2 south; 3 north; 4 east; 5 west)
ItemRotation Determines the rotation of the item in the item frame Numerical, 0 - 7 (Clockwise)
Item Determines the item in the item frame A string >
Invisible Determines if the item frame is invisible 0b or 1b
Fixed Determines if the item frame is fixed 0b or 1b

Potion [ ]

These tags are used to customize potions

Armor Stand [ ]

These tags are used when summoning armor stands.

NBT Tag Description Value type Syntax
NoGravity Toggles gravity 0b or 1b (0b for false, 1b for true)
ShowArms Determines whether you can see the armor stand's arms or not. Byte, 0b or 1b (0b for false, 1b for true)
NoBasePlate Determines whether the armor stand has a base plate or not. Byte, 0b or 1b
Small Determines whether the armor stand is small or not. Byte, 0b or 1b
Rotation Changes the rotation of the armor stand Byte, 0b or 1b
Marker Small Hit box Byte, 0b or 1b
Pose Changes the pose of the armor stand's body parts. Any subtag can be ommited Byte, 0b or 1b >
Invisible Determines whether the armor stand is invisible or not. Byte, 0b or 1b

Note: The Equipment tag also works for armor stands.

Turtle [ ]

These tags are used when summoning turtles.

Tagname Description Value type Syntax
HomePosX Determines the X coordinate of a turtle's home beach. Numerical
HomePosY Determines the Y coordinate of a turtle's home beach. Numerical
HomePosZ Determines the Z coordinate of a turtle's home beach. Numerical
TravelPosX Determines the distance a turtle can lay eggs from its home coordinates, on the X axis. Numerical
TravelPosY Determines the distance a turtle can lay eggs from its home coordinates, on the Y axis. Numerical
TravelPosZ Determines the distance a turtle can lay eggs from its home coordinates, on the Z axis. Numerical
HasEgg Determines if the turtle has an egg to lay 0 – 0b – false
1 – 1b – true

[Гайд] Изучаем структуру NBT с нуля

[Гайд] Изучаем структуру NBT с нуля

Итак, давайте определимся с тем, что-же такое структура NBT. Упрощённое определение находится ниже.

NBT или Named Binary Tags - это формат хранения данных мира, разработанный Нотчем. Использует расширение .mclevel.

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

NBT код, с версии 1.7, может быть изменён непосредственно в игре, что значительно упрощает работу создателей карт, так как до этого изменить дополнительные параметры было возможно только используя специальные дополнения.

Итак, теперь давайте разберёмся с символами, которые нам потребуются. Фигурные скобки (< и >) потребуются нам в самом начале. Например: /summon Zombie var:1>. Также фигурные скобки нужны, если какой-либо объект в массиве может иметь дополнительные параметры (Например: Параметры брони моба, /summon Zombie ]>). Квадратные скобки ([ и ]) нужны для открытия и закрытия массивов. Например: /summon Zombie [var:1]>. Присвоение значений производится с помощью знака ":". Например: /summon Zombie :1>. Для разделения различных параметров, нам потребуется запятые. Например: /summon Zombie ,var:1>

Список всех возможных параметров для тех, или иных объектов можно найти здесь. Они не переведены на русский язык. Поэтому их придётся переводить самому.

Items [ ]

These can be used in /give and /replaceitem commands as well as /clear . For commands such as /summon and /setblock , place them inside of a tag.

These tags can be used on any item.

Color is a hexadecimal color value, except in decimal. An RGB to hexadecimal converter can be found here and a hexadecimal to decimal converter can be found here. Names and lore must be passed as raw JSON text.


The following syntax can also be used, and eliminates the need for backslashes:

To hide multiple tags, you need to add the value of the tags you want to hide. For example, if you want to hide the "Enchantments" and the "Attributes modifiers" tags, the value you need to put is 3 (1+2).

VALUE ranges from 1 to 127, representing 127 combinations.

Adding 1 hides "Enchantments"

Adding 2 hides "AttributeModifiers"

Adding 4 hides "Unbreakable"

Adding 8 hides "CanDestroy"

Adding 16 hides "CanPlaceOn"

Adding 32 hides other information, including potion effects, shield pattern info, "StoredEnchantments", written book "generation" and "author", "Explosion", "Fireworks", and map tooltips

Adding 64 hides "Dyed" on leather armors

Allowed 1 amount of same NBT Tags.

Unknown amount of allowed same NBT Tags.

The following table describes more details on Enchantments sub-tag.

Tagname Description Value Type Allowed Values Example
id Refers to the id of an enchantment. See Enchanting for details on which id correlates to which enchantment. String Enchantment ID "minecraft:efficiency"
lvl Determines the level of an enchantment. A level between one and ten displays properly on an item as a roman numeral, however, any value above that displays as enchantment.level.lvl. Numerical -2147483648 to 2147483647 4

The following table describes more details on display sub-tag.

The following table describes more details on the Fireworks sub-tag.

Colors is the initial color of the explosion written in decimal format.

FadeColors is the color that the explosion will fade to written in decimal format.

Flicker is whether the whether the explosion flickers while it fades. This is the effect applied when you add glowstone to the firework star.

Trail is whether the particles leave trails as they travel. This effect is applied when you add a diamond to the firework star.

Type is the shape of the firework:

0 is small ball,

1 is large ball,

2 is star-shaped,

3 is creeper-shaped,

Blocks [ ]

These tags are put on blocks as items.

[Гайд] Разбираем NBT теги: Все мобы

[Гайд] Разбираем NBT теги: Все мобы

Итак, теги будут описаны в таком-же формате, как и на англоязычной WIKI.

[Гайд] Разбираем NBT теги: Все мобы


Все мобы:
HealF: Количество здоровья моба. Измеряется в половинках сердец. Если установлен, то Health игнорируется.
Health: Количество здоровья моба.
AbsorptionAmount: Дополнительное здоровье моба.
AttackTime: Сложный перевод. Описать его словами очень трудно (Number of ticks the mob's "invincibility shield" lasts after the mob was last struck. 0 when not recently hit).
HurtTime: Сложный перевод. Описать его словами очень трудно (Number of ticks the mob turns red for after being hit. 0 when not recently hit.).
DeathTime: Значение "0" показывает, что моб уже мёртв.
Attributes (Массив): Атрибуты моба.
-Name: Имя атрибута.
-Base:: Базовое значение атрибута.
-Modifiers (Массив): Будет описано отдельно.
ActiveEffects (Массив): Эффекты, наложенные на моба
-Id: ID эффекта.
-Amplifier: Уровень эффекта.
-Duration: Длительность эффекта.
-Ambient: 1 - если эффект обеспечивается маяком. Если нет - 0.
-ShowParticles: 1 - если частицы показаны. Если нет - 0.
Equipment (Массив): То, что надето на игрока.
-0: Предмет, который находится в руке.
-1: Ноги
-2: Поножи
-3: Нагрудник
-4: Голова
DropChances (Массив): Выпадающие с моба вещи.
-0: Предмет, который находится в руке.
-1: Ноги
-2: Поножи
-3: Нагрудник
-4: Голова
CanPickUpLoot: 1 - если моб может поднимать вещи. Если нет - 0.
PersistenceRequired: 1 - если моб не может естественно исчезнуть. Если может - 0.
CustomName: Имя моба.
CustomNameVisible: 1 - если пользовательское имя видно. Если нет - 0.
Leashed: 1 - если моб на поводке. Если нет - 0.
Leash (Массив): Значение данного массива и его параметры нужны только для профессионалов. Если они Вам интересны - посмотрите на WIKi.
GoldenAppleOverflow: Удалено.

Блоки [ ]

Массив данных в этом формате используется для определения типов блоков, которые размещены на карте. Число байтов в массиве может быть рассчитано путем умножения размеров трёхмерной карты. Координата Y выступает в качестве вертикального показателя, а не Z, как принято в базовой трёхмерной системе координат. Для значений Hex смотрите нумерация данных.

Чтобы получит доступ к конкретному блоку из массива данных про XYZ координаты, используйте следующую формулу:

Показатель = x + (y * высота + z) * ширина

Читайте также: