Minecraft Wiki

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

了解更多

Minecraft Wiki
Advertisement
Ic translate
此条目的(部分)内容需要翻译。

你可以帮助我们来翻译此条目,但请勿使用机器翻译

<player>.dat files are used by Servers and Singleplayer Servers to store the state of individual players. The format is also used within level.dat files to store the state of the Singleplayer player, which overrides any <player>.dat files with the same name as the Singleplayer player. These files are in NBT format.

NBT内容

  • 根标签。在level.dat文件里,它叫“Player”。
    • 实体裏面除了"id"以外的所有标签。
    • 生物裏面的所有標签。
    •  Dimension: 这个数据写明了玩家现在在哪个世界。-1表示下界,0表示主世界(或超平坦世界),1表示末路之地。其他數值被解释为0。
    •  playerGameType: 这个数据指明了玩家的游戏模式。0表示生存模式,1指创造模式,2指冒险模式
    •  SpawnX: 看下面。
    •  SpawnY: 可能不存在。玩家的床的座标。These tags are only removed if the player attempts to respawn with no valid bed to spawn at at these coordinates.
    •  SpawnZ: 看上面。
    •  SpawnForced: 1 or 0 (true/false) - 玩家应該重生在以上座标時為真在沒有床的時候.
    •  Sleeping: 1 or 0 (true/false) - 若玩家正在睡觉时为真, has no effect on whether the player is in a bed when they log in.
    •  SleepTimer: 自玩家睡觉开始 when this tag was saved. 无效果.
    •  foodLevel: 这个数据指明了饥饿值,最大为20。详见饥饿条目。
    •  foodExhaustionLevel: 详见饥饿条目。
    •  foodSaturationLevel: 详见饥饿条目。
    •  foodTickTimer: 详见饥饿条目。
    •  XpLevel: 显示玩家的經验值
    •  XpP: The progress/percent across the XP bar to the next level.
    •  XpTotal: The total amount of XP the player has collected over time; used for the Score upon death.
    •  Inventory: Each compound tag in this list is an item in the player's inventory.
      • An item in the inventory, includes the Slot tag.
    •  EnderItems: 如果玩家的 Ender chest 裡面沒有物品,這將會是一個包含0的Byte tags的清單,如果有物品,這將會是一個包含Compound tags的清單。
      • 箱子裏的物品,includes the Slot tag. Slots are numbered 0 to 26.
    •  abilities: 玩家拥有的能力。
      •  walkSpeed: 步行速度,永远是0.1。
      •  flySpeed: 飞行速度,永远是0.05。
      •  mayfly: 1 or 0 (true/false) - 玩家能飞行時为真。
      •  flying: 1 or 0 (true/false) - 当玩家正在飞行时为真。
      •  invulnerable: 1 or 0 (true/false) - 如果玩家能抵消所有傷害和有害的效果时为真,除了虚空傷害。(由/kill指令造成的傷害是为虚空傷害)
      •  mayBuild: 1 or 0 (true/false) - 当玩家可以摧毀及放置方块时为真。
      •  instabuild: 1 or 0 (true/false) - 当玩家可以瞬間摧毀方块时为真。

物品内容

Items are used both in the player's inventory and Ender inventory, and in chest tile entities, dropped item entities, furnace tile entities, brewing stand tile entities, and Villager trading recipes. Sometimes a Slot tag is used to specify the slot the item is in, such was with chests; other times there is no Slot tag, such as with dropped items.

  • The item's root tag. Some instances may give this tag a name, other times it is nameless because it is in a list.
    •  Slot: May not exist. The inventory slot the item is in.
    •  id: 物品ID和方块ID.
    •  Damage: The data value for this item. The name "Damage" comes from when only tools used this value, now many other items use this value for other purposes.
    •  Count: Number of items stacked in this inventory slot. Any item can be stacked, including tools, armor, and vehicles. Range is -128 to 127. Values below 2 are not displayed in-game.
    •  tag: Additional information about the item.
      •  ench: Contains enchantments for this item.
        • One of these for each enchantment.
          •  id: Id of the Enchantment.
          •  lvl: Level of the Enchantment
      •  StoredEnchantments: Contains enchantments for enchanted books.
        • One of these for each enchantment. Contents have same format as ench tag.
      •  title: For Written Book, the title of the book.
      •  author: For Written Book, the author of the book.
      •  pages: For Book and Quill and Written Book, the list of pages in the book.
        • A single page in the book.
      •  display: Display properties.
        •  color: The color of the item (used most commonly for leather armor). Color codes are calculated from the Red, Green and Blue components using this formula: Red<<16 + Green<<8 + Blue
        •  Name: The name to display for an item.
        •  Lore: List of strings to display as lore for the item.[1]
          • A Line of text for the lore of an item.
      •  CustomPotionEffects: Contains custom potion effects for potions. If this is not included, default is used. The color is defined by its data value
        • One of these for each potion effect.
          •  Id: The ID of the potion effect.
          •  Amplifier: The amplifier of the potion effect, starting at 0, meaning Strength I will be 0 and Strength II will be 1.
          •  Duration: The duration of the potion effect in ticks.
          •  Ambient: 1 or 0 (true/false) - this corresponds to the Ambient potion effect variable for mobs, but seems to have no effect when added to an item. If this tag is included, the game expects it to be of type TAG_Byte, but it may safely be omitted.
      •  SkullOwner: 此数据写明了的拥有者。如果你在这个数据写上了正版用户的名字(例如Notch),那么这个头颅将会显示那位用户的皮肤。(盗版用户不能享受此功能,而且只能用在物品上,方块不能)[2]
      •  RepairCost: Number of enchantment levels to add to the base level cost when repairing, combining, or renaming this item with an Anvil.
      •  map_is_scaling: 1 or 0 (true/false) - unknown.
      •  Explosion: One of these may appear on a firework star.
        •  Flicker: 1 or 0 (true/false) - true if this explosion will have the Twinkle effect (glowstone dust). May be absent.
        •  Trail: 1 or 0 (true/false) - true if this explosion will have the Trail effect (diamond). May be absent.
        •  Type: The shape of this firework's explosion. 0 = Small Ball, 1 = Large Ball, 2 = Star-shaped, 3 = Creeper-shaped, 4 = Burst. Other values will be named "Unknown Shape" and render as Small Ball.
        •  Colors: Array of integer values corresponding to the primary colors of this firework's explosion. If custom color codes are used, the game will render it as "Custom" in the tooltip, but the proper color will be used in the explosion.
        •  FadeColors: Array of integer values corresponding to the fading colors of this firework's explosion. Same handling of custom colors as Colors. May be absent.
      •  Fireworks: One of these may appear on a Firework Rocket.
        •  Flight: Number from 1-3 indicating the flight duration of this firework (equals the amount of gunpowder used in crafting the rocket). This value can also be smaller to make the firework detonate sooner - however, values of -2 and under almost never detonate at all.
        •  Explosions: List of compounds representing each explosion this firework will cause.
          • Same format as 'Explosion' compound on a firework star, as described above.

References

Advertisement