你可以帮助我们来翻译此条目,但请勿使用机器翻译。
区块(Chunks)以16*256*16立方块为单位存储地形和实体信息。为了提高Minecraft的运行效率,区块同时储存预处理的光照、等高线数据及其他元数据信息。
“区块”概念在Minecraft Infdev阶段时首次引进。 在Beta 1.3版本引进MCRegion之前, Minecraft以36进制编码的区块坐标为文件名,将区块信息储存在独立的“.dat”文件中(Alpha level format)。为了减少磁盘占用,MCRegion将地平面上32*32平方块内的所有区块打包存储在以十进制编码的区块坐标为文件名的“.mcr”文件中;这种存储方式降低了Minecraft运行时同时打开的文件数量。MCRegion后来被当下的Anvil文件格式取代,新格式沿用了MCRegion打包存储的方法,并使用了新的“.mca”文件格式。
Anvil文件格式相比MCRegion最大的改进是将区块分割,一个16*256*16大小的区块最多能分割出16个16*16*16的部分,所以全空区域的数据可以不被保存。支持的方块ID也从以前的0到255调整为0到4095,不过现在(2012年11月22日时)Minecraft还不能完美实现ID从0到4095的所有方块的存储,且256到4095的这些方块ID有很多已经被物品占用。
现在(2012年11月22日时),方块的辅助信息独立地被保存在区块信息内,特别的,天空光照(SkyLight)和(BlockLight)两个数组信息不在挂在方块ID后。Anvil文件格式出现后, 开发组在Notch原先设想的基础上对NBT格式(二进制命名标签格式)做出了改变,添加了一个和字节数组标签(byte array tag)相近的整数数组标签(integer array tag)——只有区块的等高线信息使用NBT格式存储。
NBT结构
又见: information from the Anvil format page 区块使用NBT格式存储时遵循以下结构:
- 根标签
- Level: 区块数据
- xPos: 区块的X坐标
- zPos: 区块的Z坐标
- LastUpdate: 自该区块上次更新以来经过的刻。
- TerrainPopulated: 布尔值,指示区块内的地区存不存在特殊的事物,如矿石、特殊方块、树木、地牢、花、瀑布等。如果该值为“假”或“0” 则游戏会在已经存在的方块内生成这些事物。
- Biomes: 256字节的生物群系信息,有些区块可能不具备该信息。区块内垂直的一列占用一字节空间,生物群系ID可在数据值页面查看。如果这个数组不存在,游戏在加载和保存区块时会自动添加并赋值;若数组内任何数值为“-1”,游戏也会根据正确信息改正。
- HeightMap: 1024 字节(256 TAG_Int) of heightmap data. 16 x 16. Each byte records the lowest level in each column where the light from the sky is at full strength. Speeds computing of the SkyLight. Note: This array's indexes are ordered ZX whereas the other array indexes are ordered XZ or YZX.
- Sections: List of Compound tags, each tag is a sub-chunk of sorts.
- Y: The Y index (not coordinate) of this section. Range 0 to 15 (bottom to top), with no duplicates but some sections may be missing if empty.
- Blocks: 4096 bytes of block IDs defining the terrain. 8 bits per block, plus the bits from the below Add tag. 3D order YZX.
- Add: May not exist. 2048 bytes of additional block ID data. The value to add to (combine with) the above block ID to form the true block ID in the range 0 to 4095. 4 bits per block. 3D order YZX. Combining is done by shifting this value to the left 8 bits and then adding it to the block ID from above.
- Data: 2048 bytes of block data additionally defining parts of the terrain. 4 bits per block. 3D order YZX.
- BlockLight: 2048 bytes recording the amount of block-emitted light in each block. Makes load times faster compared to recomputing at load time. 4 bits per block. 3D order YZX.
- SkyLight: 2048 bytes recording the amount of sunlight or moonlight hitting each block. 4 bits per block. 3D order YZX.
- Entities: Each TAG_Compound in this list defines an entity in the chunk. See Entity Format below. If this list is empty it will be a list of Byte tags.
- TileEntities: Each TAG_Compound in this list defines a tile entity in the chunk. See Tile Entity Format below. If this list is empty it will be a list of Byte tags.
- TileTicks: May not exist. Each TAG_Compound in this list is an "active" block in this chunk waiting to be updated. These are used to save the state of redstone machines, falling sand or water, and other activity. See Tile Tick Format below. This tag may not exist.
- Level: 区块数据
方块格式
In the Anvil format, block positions are ordered YZX for compression purposes.
The coordinate system is as follows:
- X 增加向东,减少向西
- Y 增加向上,减少向下
- Z 增加向南,减少向北
每个区块都是由 16x16x16个方块组成的, with up to 16 sections in a chunk. Section 0 is the bottom section of the chunk, and section 15 is the top section of the chunk. To save space, completely empty sections are not saved. Within each section is a byte tag "Y" for the Y index of the section, 0 to 15, and then byte arrays for the blocks. The "Block" byte array has 4096 partial block IDs at 8 bits per block. Another byte array "Add" is used for block with IDs over 255, and is 2048 bytes of the other part of the 4096 block IDs at 4 bits per block. When both the "Block" and "Add" byte arrays exist, the partial ID from the "Add" array is shifted left 8 bits and added to the partial ID from the "Blocks" array to form the true Block ID. The "Data" byte array is also 2048 bytes for 4096 block data values at 4 bits per block. The "BlockLight" and "SkyLight" byte arrays are the same as the "Data" byte array but they are used for block light levels and sky light levels respectively. The "SkyLight" values represent how much sunlight or moonlight can potentially reach the block, independent of the current light level of the sky.
The pseudo-code below shows how to access individual block information from a single section. Hover over text to see additional information or comments.
byte Nibble4(byte[] arr, int index){ return index%2 == 0 ? arr[index/2]&0x0F : (arr[index/2]>>4)&0x0F; } int BlockPos = y*16*16 + z*16 + x; byte BlockID_a = Blocks[BlockPos]; byte BlockID_b = Nibble4(Add, BlockPos); short BlockID = BlockID_a + (BlockID_b << 8); byte BlockData = Nibble4(Data, BlockPos); byte Blocklight = Nibble4(BlockLight, BlockPos); byte Skylight = Nibble4(SkyLight, BlockPos);
实体格式
每个实体是一个包含在区块文件的实体列表中的一个TAG_Compound(协议标签)。唯一例外的是玩家(Player)实体,它储存在level.dat,或者在<player>.dat的服务器文件中。 所有实体都共享这些基础标签:
- 实体数据
- id:实体ID。这个标签不存在于玩家(Player)这个实体。
- Pos:3个TAG_Doubles来描述当前实体的位置。
- Motion:3个TAG_Doubles来描述该实体此时在三维方向上的速度矢量,以米/刻为单位。
- Rotation:2个TAG_Floats(浮点标签)来表示旋转速度。
- 鸟瞰视角中实体围绕Y轴的旋转(称为偏航),因为正西角被定为为0度,所以这个值不会超过360度。
- 实体与地平线的倾角(称为仰角)。水平时为0,正值表示向下,不会超过±90度。
- FallDistance:实体已经下降的距离。更大的值让实体接触地面时受到更大的伤害。
- Fire:直到火被扑灭时的时间刻数。负值代表实体可以站在火里燃烧多久。不在火中时默认为-1。
- Air: 实体现有的氧气值,单位为刻。在空气中时保持为最大300,意味着实体在溺水前有15秒的(憋气)时间(译者注:1秒=20游戏刻),在实体死亡前总计有35秒的时间(设其有20生命值计)。在水下时该值减少,减为0时意味着溺水,实体会每秒损失1点生命值。
- OnGround:1 或者 0 (true/false)-当实体接触地面时为真(ture)。
- Dimension:未知使用。实体只是被保存在相应世界的区域文件中。-1为下界,0为主世界,1为末路之地。
- Invulnerable:1 或者 0 (true/false)-开启后在实体不受伤害,对生物与非生物都适用。生物不会受到任何来源的伤害(包括药水效果),物体如载具、物品展示框也不会被破坏,除非移除他们的支持物。请注意,这些实体也不会被钓鱼竿、攻击、爆炸或抛射物破坏(只能被Kill掉)。
- PortalCooldown:实体可以再次通过一个传送门或类似物的时间,单位为刻。在一次传送后被初始为900刻(45秒),然后倒计到0为止。
- UUIDMost:该实体最高有效位Universally Unique IDentifier。与UUIDLeast形成该实体唯一ID。
- UUIDLeast:该实体最低有效位Universally Unique IDentifier。
- Riding:被骑乘实体的id数据。注意:如果实体处于骑乘状态,堆叠中“最高”的实体拥有Pos标签,而该标签指定了“最低”的实体的坐标。同样注意,“最低”的实体控制这堆实体的运动;当实体堆叠由刷怪箱生成时,生成条件由最上方的实体决定。
- 参见这个格式(递归)。
生物
每个生物都有额外的标签来储存它们的血量, 状态,效果. 玩家是生物的一个子类.
| 生物实体 | |
|---|---|
| 实体ID | 名称 |
| Bat | 蝙蝠 |
| Blaze | 烈焰人 |
| CaveSpider | 洞穴蜘蛛 |
| Chicken[备注 1] | 鸡 |
| Cow[备注 1] | 牛 |
| Creeper | 爬行者 |
| EnderDragon | 末影龙 |
| Enderman | 末影人 |
| Endermite | 末影螨 |
| Ghast | 恶魂 |
| Giant | 巨人 |
| Guardian | 守卫者 远古守卫者 |
| EntityHorse | 马 |
| LavaSlime | 岩浆怪 |
| MushroomCow[备注 1] | 哞菇 |
| Ozelot[备注 1][备注 2] | 豹猫 |
| Pig[备注 1] | 猪 |
| PigZombie | 僵尸猪人 |
| Rabbit | 兔子 |
| Sheep[备注 1] | 羊 |
| Silverfish | 蠹虫 |
| Skeleton | 骷髅 凋灵骷髅 |
| Slime | 史莱姆 |
| SnowMan | 雪傀儡 |
| Spider | 蜘蛛 |
| Squid | 鱿鱼 |
| Villager[备注 1] | 村民 |
| VillagerGolem | 铁傀儡 |
| Witch | 女巫 |
| WitherBoss | 凋灵 |
| Wolf[备注 1][备注 2] | 狼 |
| Zombie | 僵尸 僵尸村民 |
注:刻的对应时间是1/20秒。
- 生物有这些额外的特殊标签:
- Health: 代表该实体拥有的生命值,数值1代表半颗心。如果HealF被设定则会被忽略。
- HealF: 代表血量的浮点值,如果它被设置,Health将被忽略。
- AbsorptionAmount: 代表伤害吸收效果所添加的额外生命值。
- AttackTime: 代表此生物被攻击后的无敌时间(刻),0代表最近没有被攻击过。
- HurtTime: 代表此生物被攻击后变成红色的时间(刻),0代表最近没有被攻击过。
- DeathTime: 代表生物死亡后的时间(刻)。用于控制死亡动画,0代表活着。
- Attributes: 此生物所拥有的属性列表。这些数值对内部计算有多种用途,也可以算是一个生物的"统计列表"。一个生物的有效属性将在主页面中列出。
- 单个属性
- Name: 属性的名称
- Base: 属性的基础数值
- Modifiers:作用于此属性的修饰符列表。修饰符会在不更改基础数值的情况下在内部计算中修改基础数值。要注意的是,对于单个属性,修饰符永远不会将基础数值提升到最大值之上或将其将至最小值之下。
- An individual Modifier.
- Name: The Modifier's name.
- Amount: The amount by which this Modifier modifies the Base value in calculations.
- Operation: 0, 1, or 2. Defines the operation this Modifier executes on the Attribute's Base value. 0: Increment X by Amount, 1: Increment Y by X * Amount, 2: Y = Y * (1 + Amount) (equivalent to Increment Y by Y * Amount). The game first sets X = Base, then executes all Operation 0 modifiers, then sets Y = X, then executes all Operation 1 modifiers, and finally executes all Operation 2 modifiers.
- UUIDMost: The most significant bits of this Modifier's Universally Unique IDentifier. Used to reference modifiers in memory and ensure duplicates are not applied.
- UUIDLeast: The least significant bits of this Modifier's Universally Unique IDentifier.
- An individual Modifier.
- 单个属性
- ActiveEffects: 代表生物存在的药水效果列表,可能不存在。
- 单个药水效果
- Id: 效果 ID.
- Amplifier: 效果的等级,0代表1级
- Duration: 距离效果结束的时间(刻)
- Ambient: 1 或者 0 (true/false) – true代表该效果是由信标提供并降低颗粒的可见性。
- 单个药水效果
- Equipment: 代表生物装备物品的复合标签列表。列表中的每个复合标签都是一个没有物品栏槽位的物品,这5个条目是肯定存在的(即使是玩家),但其空的复合标签会代表没有物品。
- 0: 生物手上的物品。
- 1: 装备(脚)
- 2: 装备(腿)
- 3: 装备(胸)
- 4: 装备(头)
- DropChances: 代表装备物品掉落几率的浮点值列表,范围是0-1。默认的都是0.085,但如果是捡起的物品则被设为1
- 0: 掉落生物带着的物品的概率。
- 1: 掉落盔甲(脚)的概率。
- 2: 掉落盔甲(腿)的概率。
- 3: 掉落盔甲(胸)的概率。
- 4: 掉落盔甲(头)的概率。
- CanPickUpLoot: 1 或者 0 (true/false) – true代表生物能捡起物品(穿上捡起的盔甲,使用捡起的武器)。
- PersistenceRequired: 1 或者 0 (true/false) – true代表生物不会天然地消失。
- CustomName: 该生物的自定义名称,该名称可以显示在生物头上,或者交易栏,死亡信息上面。可能不存在。
- CustomNameVisible: 1 或者 0 (true/false) – 如果是true,那么自定义名称会一直出现,无论光标是否有指向它。可能不存在。
- Leashed: 1 或者 0 (true/false) – 代表该生物是否被拴住
- Leash: 要么包含着所连接实体的唯一识别码,要么包含着被拴住的栅栏方位
- UUIDMost: The most significant bits of the Universally Unique IDentifier of the entity this leash connects to.
- UUIDLeast: The least significant bits of the Universally Unique IDentifier of the entity this leash connects to.
- X: 拴绳连接的栅栏X坐标
- Y: 拴绳连接的栅栏Y坐标
- Z: 拴绳连接的栅栏Z坐标
-
GoldenAppleOverflow(移除): 未知数值
可以繁衍的生物有这些额外的字段:
- InLove: 此生物冒出爱心并寻找配偶的剩余时间(刻)。0代表不会寻找配偶。
- Age: 代表这个生物的成长时间(刻);负数代表此生物是婴儿,0以上代表此生物已成年。在高于0时,它代表此生物还有多久才能再次繁殖。
- 可以被驯服的生物有这些额外的字段:(马除外):
- Owner: 主人玩家名称,如果没有主人则为空。
- Sitting: 1 或者 0 (true/false) – true代表生物坐下了
- Bat有这些额外的字段:
- BatFlags: 1代表正在倒挂在方块上,0代表正在飞行
- Creeper有这些额外的字段:
- powered: 1 或者 0 (true/false) – 可能不存在。True代表爬行者被闪电击中并变成高压爬行者。
- ExplosionRadius: 爆炸的半径,默认为3
- Fuse: 距离爬行者爆炸的时间(刻)(并不会影响正在掉落并会在落地时爆炸的爬行者)。默认为30.
- Enderman有这些额外的字段:
- carried: 被末影人拿起的方块的ID,0代表没有拿起任何方块
- carriedData: 末影人所拿起的方块的额外数据,0代表没有拿起任何方块
- EntityHorse有这些额外的字段:
- Bred: 1 或者 0 (true/false) – 未知。在繁殖后保持0。会导致马变得很固执。
- ChestedHorse: 1 或者 0 (true/false) – true代表马戴着箱子。如果马拥有箱子的话会导致游戏崩溃。
- EatingHaystack: 1 或者 0 (true/false) – true代表马在进食
- HasReproduced: 1 或者 0 (true/false) – 暂未使用。始终为0
- Tame: 1 或者 0 (true/false) – true代表已被驯服
- Temper: 范围是0-100。随着喂食提升。数值越高越容易被驯服。
- Type: 马的类型, 0 = 马,1= 驴,2= 骡,3 = 僵尸,4 =骷髅.
- Variant: The variant of the horse. Determines colors. Stored as
baseColor | markings << 8. - OwnerName: 包含驯服它的玩家名字,不会对行为产生影响
- Items: 物品列表。仅在ChestedHorse为true时存在。
- An item, including the Slot tag. Slots are numbered 2 to 16 for donkeys and mules, and none exist for all other horses.
- 见物品格式
- An item, including the Slot tag. Slots are numbered 2 to 16 for donkeys and mules, and none exist for all other horses.
- ArmorItem: 马所穿着的盔甲物品。可能不存在。
- 见物品格式
- SaddleItem: 马所穿着的鞍物品。可能不存在。
- 见物品格式
-
ArmorType: ( 在13w21a删除) 盔甲类型. 0 = 无,1 = 铁,2= 金,3= 钻石。其他的数值会导致加载随机的材质。 -
Saddle: ( 在13w21a删除) 1 或者 0 (true/false) – true代表马上有鞍。
- Ghast有这些额外的字段:
- ExplosionPower: 代表恶魂发出的火球的爆炸半径,默认为1。
- Guardian有这些额外的字段:
- Ender: 1 或者 0 (true/false) – ture代表远古守卫者。
- Ozelot有这些额外的字段:
- CatType: 豹猫的皮肤类型ID。0是野生豹猫, 1是西服猫,2是虎斑猫, 3是暹罗猫。并不会改变豹猫的行为。只要其Owner字符串是空的那么它就是野生的,这表示野生的豹猫看上去能和猫一样,反之亦然。
- Pig有这些额外的字段:
- Saddle: 1 或者 0 (true/false) – true代表猪上有鞍。
- Rabbit有这些额外的字段:
- RabbitType: 兔子的类型,杀手兔为99。
- Sheep有这些额外的字段:
- Sheared: 1 或者 0 (true/false) – ture代表羊已被剪毛。
- Color: 0 to 15 – 羊毛的颜色ID,见羊毛数据值。
- Skeleton有这些额外的字段:
- SkeletonType: 0 为普通骷髅, 1 为凋灵骷髅.
- Slime和LavaSlime有这些额外的字段:
- Size: 史莱姆的大小。
- WitherBoss有这些额外的字段:
- Invul: 凋零的无敌状态的时间(刻),0代表不在无敌状态。
- Wolf 有这些额外的字段:
- Angry: 1 或者 0 (true/false) – 1代表狼在愤怒中
- CollarColor: 狼项圈的颜色,即使是野生的狼仍然存在(但不会渲染出来),默认为14
- VillagerGolem有这些额外的字段:
- PlayerCreated: 1 或者 0 (true/false) – true代表此傀儡是由玩家创造的
- Zombie有这些额外的字段:
- IsVillager: 1 或者 0 (true/false) – true代表这是僵尸村民。可能不在普通僵尸上存在。
- IsBaby: 1 或者 0 (true/false) – true代表此僵尸为幼儿。可能不在普通僵尸上存在。
- ConversionTime: -1代表不在变回村民的过程中,正数代表变回村民的剩余时间(刻)。再生效果会与此平行。
- PigZombie有这些额外的字段:
- 继承Zombie的所有字段
- Anger: 愤怒水平,0代表中立。
弹射物
弹射物是实体的一个分支并有非常晦涩的标签,如尽管存在Entity Pos标签但仍加入X、Y、Z方位标签,尽管存在inGround但仍加入inTile,以及尽管多数弹射物不是箭但仍加入shake标签。
| 弹射物实体 | |
|---|---|
| 实体ID | 名称 |
| Arrow | 箭 |
| Snowball | 雪球 |
| Egg (已移除 – 漏洞?) | 鸡蛋 |
| Fireball | 恶魂火球 |
| SmallFireball | 烈焰人火球/火焰弹 |
| ThrownEnderpearl | 末影珍珠 |
| ThrownExpBottle | 附魔之瓶 |
| ThrownPotion | 喷溅药水 |
| WitherSkull | 凋灵之首 |
- 弹射物有这些额外的字段:
- xTile: 该实体的X坐标
- yTile: 该实体的Y坐标
- zTile: 该实体的Z坐标
- inTile: 弹射物存在的方块ID
- shake: 箭弹射到方块后的颤动
- inGround: 1 或者 0 (true/false) –弹射物是否在地上或已经击中地面(用于拾起箭矢,你无法在空中接箭)
- Arrow有这些额外的字段:
- inData: 弹射物存在的方块元数据
- pickup: 0 = 无法被玩家捡起 1 = 可以被生存模式和创造模式的玩家捡起 2 = 只能被创造模式的玩家捡起
- player: 1 或者 0 (true/false) – 如果pickup没有被使用,并且该项为true,那么箭可以被玩家捡起
- damage: 暂未弄明此数值会如何影响箭实际所造成的伤害。普通的箭为2.0,每级的力量魔咒将增加0.5。如果力量魔咒存在,则额外增加0.5(力量I将给予额外1.0,力量II给予1.5)
- Fireball、SmallFireball、和WitherSkull有这些额外的字段:
- direction: 包含3个双精度浮点数的列表。应该与Motion相同。
- Fireball有这些额外的字段:
- ExplosionPower: 火球在撞击时的威力和大小。默认为1。
- ThrownEnderpearl、ThrownExpBottle、ThrownPotion、和Snowball有这些额外的字段:
- ownerName: 抛出的玩家的名字。
物品
物品是实体的一个分支
| 物品实体 | |
|---|---|
| 实体名 | 名称 |
| Item | 物品(实体) |
| XPOrb | 经验球 |
- 物品有这些额外的字段:
- Health: 物品的生命值,从5开始,物品会从火、岩浆、和爆炸受到伤害。当生命值变0时物品将会被摧毁。
- Age: 物品"未被触碰"的时间。在6000刻(5分钟)后物品将会被摧毁。
- Item有这些额外的字段:
- Item: 物品栏物品,无槽位标签
- 见物品格式。
- Item: 物品栏物品,无槽位标签
- XPOrb有这些额外的字段:
- Value: 在捡起后可以获得的经验数量
交通工具
交通工具是实体的一个分支
| 交通工具实体 | |
|---|---|
| 实体ID | 实体名 |
| Boat | 船 |
| 矿车 运输矿车 动力矿车 | |
| MinecartRideable | 矿车 |
| MinecartChest | 运输矿车 |
| MinecartFurnace | 动力矿车 |
| MinecartSpawner | 刷怪箱矿车 |
| MinecartTNT | TNT矿车 |
| MinecartHopper | 漏斗矿车 |
- All types of Minecarts may have these additional optional fields:
- CustomDisplayTile: Optional. 1 或者 0 (true/false) - whether to display the custom tile in this minecart.
- DisplayTile: 可无. 在矿车里的自定义方块的ID.
- DisplayData: 可无. 在矿车里的自定义方块的损耗值.
- DisplayOffset: Optional. The offset of the block displayed in the Minecart. Positive values move the block upwards, while negative values move it downwards. A value of 16 will move the block up by exactly one multiple of its height.
- CustomName: 可无. 矿车的自定义名称.
-
Minecart(在13w02a后去除) has these additional fields:- Type: Type of the cart: 0 - empty, 1 - with a chest, 2 - with a furnace.
- All fields from MinecartRideable, MinecartChest or MinecartFurnace depending on Type.
- MinecartChest and MinecartHopper have these additional fields:
- Items: List of items.
- An item, including the Slot tag. Slots are numbered 0 to 26 for chests, and 0 to 4 for hoppers.
- See Item Format
- An item, including the Slot tag. Slots are numbered 0 to 26 for chests, and 0 to 4 for hoppers.
- Items: List of items.
- MinecartFurnace have these additional fields:
- PushX: Force along X axis, used for smooth acceleration/deceleration.
- PushZ: Force along Z axis, used for smooth acceleration/deceleration.
- Fuel: The number of ticks until the minecart runs out of fuel.
- MinecartHopper has these additional fields:
- TransferCooldown: Time until the next transfer, between 1 and 8, or 0 if there is no transfer.
- MinecartTNT has these additional fields:
- TNTFuse: Time until explosion or -1 if deactivated.
- MinecartSpawner has these additional fields:
- All fields from the MobSpawner Tile Entity, excluding the base Tile Entity fields.
Dynamic Tiles
Dynamic tiles are a subclass of Entity and are used to simulate realistically moving blocks.
| Dynamic Tile Entities | |
|---|---|
| Entity ID | Name |
| PrimedTnt | TNT |
| FallingSand | Dynamic Tile |
- PrimedTnt has these additional fields:
- Fuse: Ticks until explosion.
- FallingSand has these additional fields:
-
Tile(deprecated): The Block ID. Not limited to only sand, gravel, dragon eggs, or anvils. Although deprecated, this value is always present. - TileID: The Block ID, as above, but now supporting the 1-4095 range.
- TileEntityData: Optional. The tags of the tile entity for this block.
- Data: 这个方块的附加值.
- Time: The number of ticks the entity has existed. If set to 0, the moment it ticks to 1, it will vanish if the block at its location has a different ID than the entity's TileID. If the block at its location has the same ID as its TileID when Time ticks from 0 to 1, the block will instead be deleted, and the entity will continue to fall, having overwritten it. (This was the result of Mojang's failed attempt to "fix" infinite sand/gravel/dragon egg/anvil/etc. generators by trying to have the falling sand entity delete the duplicated block the next tick) When Time goes above 600, or above 100 while the block is below Y=0, the entity is deleted.
- DropItem: 1 或者 0 (true/false) - 如果是true的话他会掉落方块.
- HurtEntities: 1 或者 0 (true/false) - 如果是true的话掉下时会砸死生物(如铁毡从256格的高空掉下来).
- FallHurtMax: The maximum number of hitpoints of damage to inflict on entities that intersect this FallingSand. For vanilla FallingSand, always 40 (20 hearts).
- FallHurtAmount: Multiplied by the FallDistance to calculate the amount of damage to inflict. For vanilla FallingSand, always 2.
-
其它
其它实体类型是实体的一个子类但无法分入任何上述分类。
| 其它实体 | |
|---|---|
| 实体ID | 名称 |
| EnderCrystal | 末影水晶 |
| EyeOfEnderSignal | 末影之眼 |
| FireworksRocketEntity | 烟花火箭 |
| ItemFrame | 物品展示框 |
| LeashKnot | 拴绳结 |
| Painting | 画 |
- FireworksRocketEntity有这些额外的特殊标签:
- Life: The number of ticks this fireworks rocket has been flying for.
- LifeTime: The number of ticks before this fireworks rocket explodes. This value is randomized when the firework is launched: ((Flight + 1) * 10 + random(0 to 5) + random(0 to 6))
- FireworksItem: The crafted Firework Rocket item.
- See Item format and Fireworks tag tag.
- 物品展示框和画都有这些额外的特殊标签:
- TileX: 物品展示柜的X坐标.
- TileY: 物品展示柜的Y坐标.
- TileZ: 物品展示柜的Z坐标.
- Direction: 物品展示柜的朝向.
- Dir: Same as Direction, except the meaning of values 2 and 0 are swapped. Ignored if Direction is present.
- ItemFrame有这些额外的特殊标签:
- Item: 没有槽位标签的物品标签。如果物品展示框是空的,这个标签不存在。
- See Item Structure.
- ItemDropChance: 展示框被破坏时物品掉落的几率,默认为1.0。
- ItemRotation: 物品被旋转90°的次数。
- Item: 没有槽位标签的物品标签。如果物品展示框是空的,这个标签不存在。
- Painting有这些额外的特殊标签:
- Motive: 这幅画的名字。
实体附加值格式
实体附加值在Minecraft中被用来储存不能存放在4-bit内的方块信息
| Tile Entities | |
|---|---|
| Tile Entity ID | 对应方块 |
| Airportal | 末地传送门 |
| Beacon | 信标 |
| Cauldron | 炼药台 |
| Chest | 箱子 陷阱箱 |
| Comparator | 红石比较器 |
| Control | 命令方块 |
| DLDetector | 阳光探测器 |
| Dropper | 投掷器 |
| EnchantTable | 附魔台 |
| EnderChest | 末影箱 |
| Furnace | 熔炉 |
| Hopper | 漏斗 |
| MobSpawner | 刷怪笼 |
| Music | 音符盒 |
| Piston | Piston Moving |
| RecordPlayer | 唱片机 |
| Sign | 告示牌 |
| Skull | 头颅 |
| Trap | 发射器 |
All tile entities share this base:
- Tile entity data
- id: 实体ID
- x: X coordinate of the Tile Entity.
- y: Y coordinate of the Tile Entity.
- z: Z coordinate of the Tile Entity.
- 这些容器可能会有以下额外的标签:
- CustomName:非必要。用于自定义容器的显示名称。若对命令方块使用,将会修改默认自带的“@”;例如将命令方块指令设置为/say <内容>,带上CustomName,输出的“@”将会替换成设定的名称。
- Cauldron 有以下的附加值:
- Items: List of items in the brewing stand.
- : An item, including the slot tag. Slots are numbered 0 to 3.
- See Item Format.
- : An item, including the slot tag. Slots are numbered 0 to 3.
- BrewTime: The number of ticks the potions have been brewing for.
- Items: List of items in the brewing stand.
- Chest 有以下的附加值:
- Items:在箱子里的物品.[note 1]
- : An item, including the slot tag. Chest slots are numbered 0-26 with 0 in the top left corner.
- See Item Format.
- : An item, including the slot tag. Chest slots are numbered 0-26 with 0 in the top left corner.
- Items:在箱子里的物品.[note 1]
- ↑ Double chests are simply two Chest tile entities next to each other; see Chest for which tile entity is which half of the chest.
- Comparator has these additional fields:
- OutputSignal: Represents the strength of the analog signal output by this redstone comparator. Likely used because the block itself uses its four bits of metadata to determine its rotation, powered state, and subtraction mode state, and comparators can hold a specific amount of power even in circuits without redstone wire.
- Control has these additional fields:
- Command: The command to issue to the server.
- SuccessCount: Represents the strength of the analog signal output by redstone comparators attached to this command block. Only updated when the command block is activated with a redstone signal.
- 熔炉 has these additional fields:
- BurnTime: Number of ticks left before the current fuel runs out.[note 1]
- CookTime: Number of ticks the item has been smelting for. The item finishes smelting when this value reaches 200 (10 seconds). Is reset to 0 if BurnTime reaches 0.
- Items: List of items in the furnace slots.
- : An item in the furnace, including the slot tag:
Slot 0: The item(s) being smelted.
Slot 1: The item(s) to use as the next fuel source.
Slot 2: The item(s) in the result slot.- See Item Format.
- : An item in the furnace, including the slot tag:
- ↑ The original maximum burning time for the current fuel isn't stored, thus the current time left is assumed to be the maximum when this Tile Entity is loaded into memory.
- 漏斗 has these additional fields:
- Items: List of items in the hopper slots.
- : An item in the hopper, including the slot tag.
- See Item Format.
- : An item in the hopper, including the slot tag.
- TransferCooldown: Time unil the next transfer, naturaly between 1 and 8 or 0 if there is no transfer.
- Items: List of items in the hopper slots.
- MobSpawner has these additional fields:
- SpawnPotentials: Optional. List of possible entities to spawn.[1][2] If this tag does not exist, but SpawnData exists, Minecraft will generate it the next time the spawner tries to spawn an entity. The generated list will contain a single entry derived from the EntityId and SpawnData tags.
- : A potential future spawn. After the spawner makes an attempt at spawning, it will choose one of these entries at random and use it to prepare for the next spawn.
- Type: Overwrites EntityId when preparing the next spawn.
- Weight: The chance that this spawn will be picked as compared to other spawn weights. Must be non-negative and at least 1.
- Properties: Overwrites the contents of SpawnData when preparing the next spawn. Not optional; an empty one will be created if it does not exist.
- : A potential future spawn. After the spawner makes an attempt at spawning, it will choose one of these entries at random and use it to prepare for the next spawn.
- EntityId: The Entity ID of the next entity(s) to spawn. Both Mob Entity IDs and other Entity IDs will work. Warning: If SpawnPotentials exists, this tag will get overwritten after the next spawning attempt: see above for more details.
- SpawnData: Contains tags to copy to the next spawned entity(s) after spawning. Any of the Entity or Mob tags may be used. Note that if a spawner specifies any of these tags, almost all variable data such as mob equipment, villager profession, sheep wool color, etc., will no longer be automatically generated, and must also be manually specified [3] (note that this does not apply to position data, which will be randomized as normal unless Pos is specified. Similarly, unless Size and Health are specified for a Slime or Magma Cube, these will still be randomized). This, together with EntityId, also determines the appearance of the miniature entity spinning in the spawner cage. Note: this tag is optional: if it does not exist, the next spawned entity will use the default vanilla spawning properties for this mob, including potentially randomized armor (this is true even if SpawnPotentials does exist). Warning: If SpawnPotentials exists, this tag will get overwritten after the next spawning attempt: see above for more details.
- SpawnCount: 它决定了每次生成多少个生物
- SpawnRange: The radius around which the spawner attempts to place mobs randomly. The spawn area is square, includes the block the spawner is in, and is centered around the spawner's x,z coordinates - not the spawner itself. It is 2 blocks high, centered around the spawner's y coordinate (its bottom), allowing mobs to spawn as high as its top surface and as low as 1 block below its bottom surface. Vertical spawn coordinates are integers, while horizontal coordinates are floating point and weighted towards values near the spawner itself.
- Delay: Ticks until next spawn. If 0, it will spawn immediately when a player enters its range. If set to -1 (this state never occurs in a natural spawner; it seems to be a feature accessed only via NBT editing), the spawner will reset its Delay, and (if SpawnPotentials exist) EntityID and SpawnData as though it had just completed a successful spawn cycle, immediately when a player enters its range. Note that setting Delay to -1 can be useful if you want the game to properly randomize the spawner's Delay, EntityID, and SpawnData, rather than starting with pre-defined values.
- MinSpawnDelay: The minimum random delay for the next spawn delay. May be equal to MaxSpawnDelay.
- MaxSpawnDelay: The maximum random delay for the next spawn delay. Warning: Setting this value to 0 crashes Minecraft. Set to at least 1.
- MaxNearbyEntities: Overrides the maximum number of nearby (within a box of spawnrange*2+1 x spawnrange*2+1 x 8 centered around the spawner block) entities whose IDs match this spawner's entity ID. Note that this is relative to a mob's hitbox, not their physical position. Also note that all entities within all chunk sections (16x16x16 cubes) overlapped by this box are tested for their ID and hitbox overlap, rather than just entities which are within the box, meaning a large amount of entities outside the box (or within it, of course) can cause substantial lag.
- RequiredPlayerRange: Overrides the block radius of the sphere of activation by players for this spawner. Note that for every gametick, a spawner will check all players in the current world to test whether a player is within this sphere.
-
MaxExperience(removed): Unknown. -
RemainingExperience(removed): Unknown. -
ExperienceRegenTick(removed): Unknown. -
ExperienceRegenRate(removed): Unknown. -
ExperienceRegenAmount(removed): Unknown.
- SpawnPotentials: Optional. List of possible entities to spawn.[1][2] If this tag does not exist, but SpawnData exists, Minecraft will generate it the next time the spawner tries to spawn an entity. The generated list will contain a single entry derived from the EntityId and SpawnData tags.
- Music has these additional fields:
- note: Pitch (number of right-clicks).
- Piston has these additional fields:
- blockId: Block_IDs of the block being moved.
- blockData: Data value of the block being moved.
- facing: Direction in which the block will be pushed.
- progress: How far the block has been moved.
- extending: 1 或者 0 (true/false) - true if the block is being pushed.
- RecordPlayer has these additional fields:
- Record: Record currently playing. 0 is no record. Otherwise, it is the item ID of the record (e.g. 2261 for the "mall" record). Other IDs can be used to make other items or blocks pop out with a data value of 0. This is always overridden by the ID in RecordItem.
- RecordItem: The item, without the Slot tag.
- See Item Format.
- Sign has these additional fields:
- Text1: First row of text.
- Text2: Second row of text.
- Text3: Third row of text.
- Text4: Fourth row of text.
Only the first 16 characters of each line are read, the rest are discarded.
- Skull has these additional fields:
- SkullType: The type of the skull, similar to the Item IDs. (See Data values#Heads)
- ExtraType: Name of the player this is a skull of.[4]
- Rot: The orientation, similar to signs. (See Data values#Sign_posts)
- Trap and Dropper have these additional fields:
- Items: List of items in the dispenser/dropper
- : An item, including the slot tag. Slots are numbered 0-8.
- See Item Format.
- : An item, including the slot tag. Slots are numbered 0-8.
- Items: List of items in the dispenser/dropper
Tile Tick Format
Tile Ticks represent block updates that need to happen because they could not happen before the chunk was saved. Examples reasons for tile ticks include redstone circuits needing to continue updating, water and lava that should continue flowing, recently placed sand or gravel that should fall, etc. Tile ticks are not used for purposes such as leaf decay, where the decay information is stored in the leaf block data values and handled by Minecraft when the chunk loads. For map makers, tile ticks can be used to update blocks after a period of time has passed with the chunk loaded into memory.
- A Tile Tick
- i: The ID of the block; used to activate the correct block update procedure.
- t: The number of ticks until processing should occur. May be negative when processing is overdue.
- p: If multiple tile ticks are scheduled for the same tick, tile ticks with lower p will be processed first. If they also have the same p, the order is unknown.
- x: X position
- y: Y position
- z: Z position