Minecraft Wiki

除另有声明,转载时均必须注明出处若簡繁轉換出錯,請以遊戲內為準请勇于扩充与修正内容有兴趣逛逛我们的微博沟通交流,欢迎到社区专页需要协助,请在告示板留言

了解更多

Minecraft Wiki
Advertisement

在13w36a快照之后,NBT标签(数据标签)可以在give和summon指令用作设定物品和生物的属性。每个标签的格式是<标签名称>:<数值>;并以逗号来分隔多个标签(比如{ench:[],display:{}})。List标签的数值是在[]符号里面的(比如direction:[0d,0d,0d])。Compound标签是在{}符号里面的(比如tag:{display:{}}就是两个Compound)需要留意的是,整个数据标签都是一个Compound标签(因为整个都是在{}里面)。标签的名称是对大小写敏感的,同时空白符号会被忽略。

如果想看关于实体的数据标签,请到区块格式。这个页面同时有一些数据标签的基本资料。

如果那个标签名字是无,那么这个标签可以直接放在数据标签的开头。

物品

这些标签能够用在 /give/replaceitem/clear命令里。如果是/summon/setblock,请把它们放在tag标签里,比如:{id:"stone",Count:3 ...,tag:{Name:"你的名字"...}} 这些标签只能用在物品上

数据标签 描述 容许有的子标签 必须有的子标签 格式
物品 物品的id就是它的种类(可以是数字id或者是文字id,但在1.8开始,所有探测类的命令需要的都是"minecraft:名字",而不能直接输入名字或者是数字id,就算他们在一般情况是能被接纳的),Damage就是数据值,当那个物品没有Count(数量),它就不能被捡起。 id, Damage, Count, tag id {Item:{id:#,Damage:#,Count:#,tag:{“物品的数据标签”}}}
ench 使那个物品被附魔。有那个附魔的id以及附魔的等级(lvl)。能够制定只有1个附魔还是多个附魔。 id, lvl 所有 {ench:[{id:#,lvl:#},{id:#,lvl:#}]}
display Name:用作增加自定义的名称,color:颜色(皮革装备),Lore:以及为物品提供描述。能够有多行描述

Color 是一个16进制的颜色数值,除了是十进制。网上的转换器可以在这里找到:

RGB 换为十六进制: http://www.yellowpipe.com/yis/tools/hex-to-rgb/color-converter.php

十六进制转为十进制: http://www.statman.info/conversions/hexadecimal.html

Name, color, Lore 至少一个 {display:{Name:"物品名字",color:,Lore:["第一行","第二行(如此类推)"]}}
AttributeModifiers 能够为生物以及物品增加属性 属性名称,名称(属性),数量,操作,UUID最小,UUID最大 所有 AttributeModifiers:[0:{AttributeName,Name,Amount,Operation}, 1:{AttributeName,Name,Amount,Operation,UUIDLeast,UUIDMost}]
Unbreakable 令工具的耐久度不会下降 Unbreakable 所有 {Unbreakable:1/0} (1 = 真, 0 = 假)
SkullOwner 用来得到玩家的头颅 SkullOwner 所有 {SkullOwner:"玩家名称"}
HideFlags (1.8) 用作隐藏那个物品的某些资料,比如附魔、能否破坏、能放在的方块等

如果要隐藏多个标签,你需要把那些标签的数值加起来。比如你想把附魔和属性修改器的资料隐藏,你需要写3(1+2)

HideFlags 所有 {HideFlags:1-32} (1 = 附魔, 2 = 属性修改器(Attribute modifier), 4 = 不能破坏, 8 = 能破坏的方块, 16 = 能放在的方块, 32 = 其他, 比如药水效果)[1]
CanDestroy (1.8) 和CanPlaceOn类似。这个标签是在冒险模式的地图里使用,以令某个工具/物品能够摧毁一个方块。这个标签是给物品/工具使用的。 一组的字符,每个都是方块的id 至少有一个 {CanDestroy:["minecraft:stone","minecraft:stonebrick"]}
PickupDelay (1.8) 那个掉落物需要等多久才能被捡起(0.05秒为1单位,单位为游戏刻) 任何数值。32767的话就永远都不能被捡起 所有 {PickupDelay:#}
Age (1.8) 那个掉落物需要多久才会消失(0.05秒为1单位,单位为游戏刻) 任何数值。-32768就永远不会消失。预设是6000(5分钟) 所有 {Age:#}
generation (.8) 用来分辨那本书是“原作”(0)、“原作的副本”(1)还是“副本的副本”(2) 0/1/2 至少一个 {generation:#}

一下这个表格对之前的子标签提供一些细节

标签名称 描述 母标签 数值类型 容许的数值
id 附魔的ID。请查看附魔,那里有各个附魔的ID ench 数字 0 - 62
lvl 决定附魔的等级。1至10的等级会正常的显示。但是,任何更大的等级会显示“enchantment.level.等级” ench 数值 0 - 32767
Name 物品的显示名称。如果是容器的方块(比如箱子和发射器),它们视窗里的名字并不会因而改变。如果是用在命令方块上,它执行命令时的名字会改变(能够以/say看见) display 字符 所有Minecraft能够显示的字符(大部分在你键盘上的字符)
Lore 在物品名称底下的文字。需要使用第三方NBT修改器来更改那个描述的颜色 display 字串 所有Minecraft能够显示的字符(大部分在你键盘上的字符)

方块

这些标签是用在物品状态的方块上的

标签名称 描述 数值种类 格式
CanPlaceOn 和CanDestroy类似。这个标签是在冒险模式的地图里使用,以令方块能放在某种方块上。这个标签是给方块使用的。 一组的字符,每个都是方块的id {CanPlaceOn:["minecraft:stone","minecraft:stonebrick"]}
BlockEntityTag 这个标签是给方块实体,用作储存他们方块形态时的资料 不同的方块都有不同的子标签,下方的方块部分有更多的资料 BlockEntityTag:{标签名称:"标签数值"}

实体

这些标签是用在/summon 命令去生成实体 或是 /entitydata 命令去更改实体的数据标签

标签名称 描述 容许的子标签 必须的子标签 格式
TileEntityData (掉落沙使用)用来储存方块的数据(方块实体)。 CustomName, Items, Command, Levels, Primary, Secondary, Delay, MaxNearbyEntities, MaxSpawnDelay, MinSpawnDelay, RequiredPlayerRange, SpawnCount, SpawnRange, EntityID

(自定义名称,项目,命令,级别,小学,中学,延迟,最大邻近实体,最大重生延迟,最小重生延迟,要求玩家范围,重生计数,重生范围,实体ID)

没有 TileEntityData:{}
direction 和motion类似,用作分辨部分实体(火球、小火球和调零之首)的方向以及速度。必须是以double的格式输入(数值后方要有d/必须有小数点),比如: {direction:[0.0,1.0,0.0]}和{direction:[0d,1d,0d]} ,生成一个向上飞(速度为1.0)。这个标签只是分辨那个实体飞行的速度以及方向,而不会影响他的面向 X, Y, Z 所有 direction:[X,Y,Z]
Motion 和direction类似,分辨大部分实体的面向(除了火球、小火球和调零之首)。 必须是以double的格式输入(数值后方要有d/必须有小数点),比如{Motion:[0.0,1.0,0.0]} 或 {Motion:[0d,1d,0d]}生成一个向上移动的实体(速度为1) X, Y, Z 所有 Motion:[X,Y,Z]
ActiveEffects 设定那个生物的药水效果(然而如果那个效果和Attribute有关,比如速度,就需要同时更改他的Attribute,否则就是没有用 Id, Duration, Amplifier, Ambient 所有 ActiveEffects:[{Id:,Duration:,Amplifier:,Ambient:},{Id:,Duration:,Amplifier:,Ambient:}]
rewardExp 控制那个村民会不会在交易之后给玩家经验 1(会)/0(不会) {rewardExp:1/0}
Riding 设定骑乘中的实体的资料(下方的实体) #这个标签不能被/entitydata更改 id, Riding, CustomName, ActiveEffects id Riding:{id:}
Equipment

这个标签是JavaScript数组与连续的值:手上拿的,靴子,护腿,胸甲和帽子.任何插槽可以是空白表示没有物品。头盔可以是一个方块,它将显示在实体头上。

Item Item Equipment:[{id:"",Count:,tag:{}...},{id:,Count:...},{id:...},{id:},{id:}]
DropChances 确定一个实体掉落持有或穿戴项目的可能性有多大。装备标签中的数量必须是1或更大的才能掉落物品。 5个独立的浮动值(每个插槽)。0.0f-1.0f决定的可能性上升,但它是随机的。任何大于1.0f将使它总是落满耐久性。 因为它是一个浮动值,它必须被诠释为“x.yf”。 {DropChances:[0.1f,2.0f,1.0f,1.1f,0.0f]
NoAI 使怪物没有智力。 1 / 0 {NoAI:0} or {NoAI:1}
Fire 确定实体被火烧灼的时间。 {Fire:1} to {Fire:32767}
Attributes 设置实体的属性,详情请见 Attribute 名字:访问 Attribute 。 数值:更改属性的程度. Modifiers: how much and how it should vary. Contains values Name, Amount, Operation, UUIDMost, UUIDLeast. Name,Base {Attributes:[{Name:"generic.maxHealth",Base:40,Modifiers:[{Name:generic.maxHealth, Amount:7,Operation:0,UUIDMost:4000,UUIDLeast:8000}]

下表提供了在NBT标签添加信息的标签名。这些标签用于 /summon

Tagname Description Used in 允许的值
Type 像不同种类的马一样改变生物种类。设置为4可以召唤一只骷髅马。 None 召唤 1 - 无限
Saddle 用来使猪或者马背上有鞍。 None 召唤 true / false 或 1 / 0
Tame 用来生成被驯服的马或者狼。 None 召唤 true / false or 1 / 0
Variant 改变马的变异种类. 不设置或设置不正确的变异会生成普通的白色马。 See Horse Variants for the list of Variants. None 召唤 1 - 1030
Size 改变一个史莱姆的大小。 比255大则生成255大小。比0小则生成0大小。大于32会导致延迟。 None 史莱姆的大小 0 - 255
Block 确定fallingsand的方块。使用数据值来找出每个块的标签。你也可以使用F3 + H展示物品的游戏ID。 None 方块名称 {Block:"minecraft:redstone_block"} 1 - 173
Time 不管方块在接触地面消失。如果设置成1方块将正常的掉落,如果设置成1以下就会被设置成0。如果设置成0方块将立刻消失。把这个数值保持在1是被推荐的,-1将永远不会消失。 None -1 - 127
DropItem Whether or not the block will drop its item form if the block is unable to be placed. If set to 0 the block will not drop its respective item, if set to 1 the block will drop its respective item. None 数值 0 或 1
id 确定被其他实体骑上的实体。 None 实体ID Any Savegame ID of an Entity
Fuse 确定一个被点燃的TNT和爬行者距离爆炸的时间。翻译君ps:Tnt默认为0,爬行者默认383 None 数值 0 - 383
ExplosionPower 设置火球的爆炸威力。 None 数值 0-127

烟花

这些标签将用于生成烟花。

NBT Tag Description Used in
LifeTime N/A 数值 {LifeTime:#}
FireworksItem N/A NBT标签 {FireworksItem:{NBT tags}}
id FireworksItem tag 数值 {FireworksItem:{id:#}}

方块

这些标签能够用在 /setblock/fill 命令里

Tagname Description Value Type Syntax
Command Used with command blocks. Places command block with command. A string {Command:"desired command"}

Generic

These tags can be used on most tile entitied blocks

Tagname Description Value Type Syntax
CustomName Displayed in the top corner of the inventory, instead of the regular name. Only works where such a regular name exists. A string. {CustomName:"Custom Name"}
Lock Says a name needed on a held item to open the inventory. A string {Lock:"Key's Name"}

信标

Tagname Description Value Type Syntax
Primary .用来设置信标的主效果,默认状态效果强度为1. 一个效果ID. {Primary:num}
Secondary 用来设置信标的辅助效果,辅助效果会增加同名主效果的等级,如果没有同名主效果则会将辅助效果强度变为1. 一个效果ID. {Secondary:num}

Spawner

These tags are used when using /setblock or /summon (spawner minecarts) to create spawners.

Tagname Description Value Type Syntax
EntityId Specifies what entity the spawner spawns. A string {EntityId:"EntityName"}
SpawnData Used for spawners that spawn entities with data tags. An entity NBT tag {SpawnData:{NBT tag}}
SpawnCount How many entities the spawner will spawn at one time. A number {SpawnCount:#}
SpawnRange The range of which the entities can spawn. A number {SpawnRange:#}
RequiredPlayerRange The range of which a player must be in for the spawner to start spawning entities. A number {RequiredPlayerRange:#}
Delay The number of ticks before entities spawn when a player is first detected. A number {Delay:#}
MinSpawnDelay After the first spawn, this is the minimum amount of ticks before more entities can spawn. A number {MinSpawnDelay:#}
MaxSpawnDelay Similar to MinSpawnDelay. After the first spawn, this is the maximum amount of ticks before more entities can spawn. A number {MaxSpawnDelay:#}
MaxNearbyEntities Checks the number of entities within the spawn range ('SpawnRange' tag). If the number of entities it detects is over the set MaxNearbyEntities number, it will not spawn more entities unless the amount of entities within the spawn range is decreased. A number {MaxNearbyEntities:#}
SpawnPotentials Used when creating spawners that spawn multiple types of entities. A string {SpawnPotentials:[{Type:"EntityName",Weight:#,Properties:{NBT tag}}]}
Weight Used if spawning multiple entities using SpawnPotentials. If the same as the SpawnPotentials entity, they will both have an even chance of spawning. A number {Weight:#}

Sub-tags used in the SpawnPotentials data tag.

Tagname Description Value Type Syntax
Type Determines the other entity that spawns with the entity specified in the EntityId data tag. MUST be used with SpawnPotentials. A string {SpawnPotentials:[{Type:"EntityName"}]}
Weight Determines the chance of spawning the entity specified in the 'Type' sub-tag. If set to the same as the other entity's weight, they will have the same chance of spawning. A number {SpawnPotentials:[{Weight:#}]}
Properties Determines the entity data tag(s) that the entity (specified in the 'Type' sub-tag) will be spawned with. An entity NBT tag {SpawnPotentials:[{Properties:{NBT tag}}]}
  1. 这里可能有过多甚至是错误的数值,使用前请先测试它们。这些标签可能需要更多的更改


Advertisement