Minecraft Wiki

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

了解更多

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

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

记分板(scoreboard)系统是一套复杂的游戏机制。通常可以由命令命令方块进行控制。

对象

对象由名称 (name)显示名称(display name)判据(criteria)以及每位玩家所对应的整数数据组成。分数的范围为-2,147,483,648至2,147,483,647没有小数。

对象的名称用于在命令中进行引用,目标参数以及在文件格式中使用。这一变量区分大小写并且只能为单一单词。

与之相反,显示名称可以由很多个单词组成,用于在不同场合进行显示。也是区分大小写的。

对象的判据决定了其行为:

判据 描述 可否编辑
dummy(虚拟变量) 只能通过命令修改分数,诸如死亡等游戏行为并不能修改分数。这可以被用来制作事件的标记、映射和通货。
trigger(触发器) 只能通过命令修改分数,诸如死亡等游戏行为并不能修改分数。 一个使用trigger做判据的对象可以被玩家利用命令/trigger来设置/增加/减少。如果/trigger命令没有对玩家启用,则使用/trigger命令会失败,并且成功使用过一次此命令后该命令将重新被关闭。值得注意的是/trigger命令可以在作弊被关闭的情况下被非管理员的普通玩家使用。这可以比较方便的通过/tellraw来使用。
deathCount(死亡次数) 当玩家死亡时,分数会自动增加。
playerKillCount(杀人数量) 当玩家杀死其他玩家时分数会自动增加。
totalKillCount(杀怪数量) 当玩家杀死其他生物时分数会自动增加。
health(生命值) 普通玩家会在0~20之间。代表玩家拥有红心数量的两倍。在玩家第一次改变血量前会显示为0。额外的血或者伤害吸收的血也会计算在血量中,也就是说当获得了伤害吸收或者生命提升的信标效果后生命值可以超过20..

在预览版13w36a中,数百个判据被加入了,[1]这些判据使用了统计和成就系统来形成一个混合判据。[2]不同于上面的简单判据,混合判据有多个部分,使用英文句号来分隔(".")。例如 "stat.entityKilledBy.Zombie"是一种混合判据,当玩家被僵尸杀死的时候才会增加。[3]

下面是已知的混合判据:

判据本名 描述 可否编辑 分判据数量
achievement(成就) 可用分判据如下: "acquireIron", "bakeCake", "blazeRod", "bookcase", "breedCow", "buildBetterPickaxe", "buildFurnace", "buildHoe", "buildPickaxe", "buildSword", "buildWorkBench", "cookFish", "diamonds", "diamondsToYou", "enchantments", "exploreAllBiomes", "flyPig", "fullBeacon", "ghast", "killCow", "killEnemy", "killWither", "makeBread", "mineWood", "onARail", "openInventory", "overkill", "overpowered", "portal", "potion", "snipeSkeleton", "spawnWither", "theEnd", and "theEnd2". 数量取决于玩家获得此成就的次数(例如,当一个玩家捡起3块木头,他的"achievement.mineWood"判据会变成3) 34
stat(统计) 基于玩家的统计来计数,接受的分判据有: "animalsBred", "boatOneCm", "climbOneCm", "crouchOneCm", "damageDealt", "damageTaken", "deaths", "diveOneCm", "drop", "fallOneCm", "fishCaught", "flyOneCm", "horseOneCm", "jump", "junkFished", "leaveGame", "minecartOneCm", "mobKills", "pigOneCm", "playerKills", "playOneMinute", "sprintOneCm", "swimOneCm", "timeSinceDeath", "treasureFished", and "walkOneCm". 当一个玩家完成分判据中的行为,分数会自动增加。 26
stat.useItem(统计.使用物品) 分判据是方块或物品的ID数和ID名(如"stat.useItem.1"和"stat.useItem.minecraft.stone")。大部分方块和物品都被接受,除了某些不存在物品形式的方块。

物品的使用次数会随着玩家使用的方块或物品的次数增加而增加。 "使用" 在下列情况被定义为:

  • 打火石剪刀 可以消耗它们的耐久度。 即使没有损耗,使用次数也会增加,例如当它们用于破坏一个方块。 每右击钓鱼竿萝卜钓竿一次,它们的使用次数就会增加,即使它们没有损耗. 当盔甲有损耗时,使用次数不会增加。
  • 一个方块被放置,A block does not have to be placed or even have the possibility of being placed. 当然方块有特定条件被放置,但是使用次数 whether a block can and is placed, 例如, 甘蔗requires water to be directly horizontally adjacent to the block on which it is being placed and needs to be placed on top of either , red sand, 泥土, podzol, 或一个草方块。但是使用次数会在玩家拿着这些方块右击之后增加(即使是 the "Use Item/Place Block" control).
  • , 刷怪蛋, 任何一种 矿车, 物品展示框, ,末影之眼, 末影珍珠, 鸡蛋, 雪球, , 任何一种可投掷的 药水, 附魔之瓶, 或 钓鱼竿 生成一个实体。
  • One of the two usable dyes are properly used. Either when cocoa beans place cocoa pods on jungle wood or bone meal is used to grow plants, such as crops or grass. The value does not increment when a dye is used on a sheep.
  • A bucket of milk, potion, or any food, save cake which is placeable, is consumed.
  • An empty map, bucket, lava bucket, water bucket, milk, book and quill, or potion creates a new item. The value does not increment when bowl becomes mushroom stew or a bucket becomes milk.
  • A record is placed in a jukebox. Each record has a different stat.

The value, however, does not increment when items are used on mobs, whether to name, tame, feed, breed, saddle, leash, shear, milk, or gather stew from; when armor is put on directly; when leather armor is washed in a cauldron; and all instances mentioned above.

There are 357 items attainable in creative mode, without using commands and including blocks with similar IDs but different datavalues, that can use this stat and 195 that cannot.

318 (636)[note 1]
stat.breakItem(统计.破坏物品) The sub-criteria are the ID number (such as "stat.breakItem.256") or ID name (such as "stat.breakItem.minecraft.bow") of an item with durability.

The value increments when the durability runs out. The durability runs out when the condition for losing durability for the item is met, and the durability becomes negative, which is the first use after the durability is zero.

50 (100)[note 1]
stat.mineBlock(统计.挖掘物品) The sub-criteria are the ID number (such as "stat.mineBlock.1") or ID name (such as "stat.mineBlock.minecraft.stone") of a block. Most blocks are accepted, except for various indestructible or technical blocks.

This increments when a player mines a block. "Mine" is defined as when a player destroys a block in a way that an item could/would drop, unless the block does not drop items like glass, or another block would be created like ice. The value does not increase when in Creative mode and will still increase if doTileDrops is set to false.

135 (270)[note 1]
stat.killEntity(统计.杀死实体) The sub-criteria are the name of an entity. Valid names are: "Bat", "Blaze", "CaveSpider", "Chicken", "Cow", "Creeper", "Enderman", "EntityHorse", "Ghast", "LavaSlime", "MushroomCow", "Ozelot", "Pig", "PigZombie", "Sheep", "Silverfish", "Skeleton", "Slime", "Spider", "Squid", "Villager", "Witch", "Wolf", and "Zombie". Increments when a player has killed the specified mob. 24
stat.entityKilledBy(统计.被实体杀死) The sub-criteria are the name of an entity. Valid names are: "Bat", "Blaze", "CaveSpider", "Chicken", "Cow", "Creeper", "Enderman", "EntityHorse", "Ghast", "LavaSlime", "MushroomCow", "Ozelot", "Pig", "PigZombie", "Sheep", "Silverfish", "Skeleton", "Slime", "Spider", "Squid", "Villager", "Witch", "Wolf", and "Zombie". Increments when a player has been killed by the specified mob.

Note that if the name of a passive mob is used the value will never increase, as those mobs are not capable of hurting the player.

24
teamkill(团队击杀数) The sub-criteria are the color of a team. Valid colors are: "black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", and "white". Increments when a player has killed a member of a team with the specified color. 16
killedByTeam(团队被击杀数) The sub-criteria are the color of a team. Valid colors are: "black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", and "white". Increments when a player has been killed by a member of a team with the specified color. 16

ID名的增加代表混合判据会是之前的两倍数量,然何人事实上数字ID的判据和ID名的判据在数量和本质上是相同的。为了方便起见,第一个表格显示了接受的ID,第二个表格显示了接受的ID名。

  1. 1.0 1.1 1.2 1.3 在版本14w06a之前,stat.craftItem, stat.useItem, stat.breakItem 和 stat.mineBlock只接受数字ID而不接受ID名。

在任何实体中无论何种判据,玩家的分数都可以通过命令的方式进行修改,生命值除外。可以增加或减少特定的值,也可以直接设置成某一特定值。命令方块也能通过参数score_name以及score_name_min对玩家的分数进行监测。在上述参数中name为所检测对象中的内部名称。score_name表示玩家分数最多为某一特定值,而score_name_min则为玩家分数至少为某一特定值。举例来说,在命令方块中输入"@p[score_deaths=5,score_deaths_min=1]"即制作一个可以当如下情况方能输出的 红石比较器: 基于"死亡数量"判据下,假定deaths为其中的一个对象,选择死亡次数至少1次,最多为5次的玩家。

记分板命令

命令 描述
scoreboard <objectives|players|teams> 使用记分板系统的底层命令。
scoreboard objectives [list] 列出所有已知的对象,其显示名称以及判据。可选参数"list"与之效果相同并可以省略。
scoreboard objectives add <name> <criteria> [display name...] 通过输入内部名称名称 (name),某一判据 (criteria),以及可选项——显示名称 (display name),创建一个新的对象。显示名称的默认值为名称所对应的值。前文中已经为这些参数进行了纤细的叙述。所有的参量都是区分大小写的。
scoreboard objectives remove <name> 在记分板系统中移除名称为name的对象的所有数据。会从对象列表,玩家分数中删除对应数据,若在显示列表中,删除后即无法显示。
scoreboard objectives setdisplay <slot> [objective] 以某种特定的显示形式 (slot)显示对象 (objective)。其中slots分为"列表 (list)"和"侧边栏 (sidebar)"。"列表"会在玩家列表中以黄色文字在玩家名称后显示分数信息(默认为 Tab 键),并不会显示对象名称。"侧边栏"则会在屏幕右侧实时显示分数信息,并会在列表的最上方显示对象的显示名称。即使玩家离线,如果在该对象下存在一定分数也会在"侧边栏"中进行显示。值得注意的是:对象 (objective)参数为可选参数:如果不提供对象则显示列表会并清零(便为其默认状态)。
scoreboard objectives cleardisplay 未使用;可能为BUG。在代码中亦没有相关说明,但是在语言文件以及错误信息中有所提及。如果希望使用清楚显示数据,可以参考上一命令。
scoreboard players [list] 显示所有被追踪的玩家,换句话说,在记分板系统中的玩家。可选参数"list"的效果相同,可以省略。
scoreboard players set <player> <objective> <score> 对象玩家的分数设置为score的值,会覆盖之前的数据。
scoreboard players add <player> <objective> <count> 对象 (objective)下的玩家 (player)分数增加某一特定值countcount至少为1。
scoreboard players remove <player> <objective> <count> 对象 (objective)下的玩家 (player)分数减少某一特定值countcount至少为1。
scoreboard players reset <player> 重置玩家 (player)分数。需要注意:这一命令会对所有对象都产生影响,并不仅仅是将其置零:而是将其整体移除记分板系统。并且很神奇的是,这一命令在与诸如'@p'这类的提示符的配合下并不能正常使用。是一个BUG?
scoreboard players player 未使用;可能为BUG。在代码中亦没有相关说明,但是在语言文件以及错误信息中有所提及。当前命令中也没有在聊天窗口中显示特定分数的命令,可能为正在制作的特性。

队伍命令

命令 描述
scoreboard teams list [teamname] 列出已创建的队伍, 并显示队伍的显示名称及其中有哪些玩家. The optional teamname parameter can be used to display all players on a particular team. If teamname is specified, it must exist and must have players.
scoreboard teams add <name> [display name... 建立一个队伍并给他一个名称级显示名称。 name must not be used by an existing team, and must be at most 16 characters. display name must be at most 32 characters, else the team will be created with a displayname identical to name and the command will seem to fail.
scoreboard teams remove <name> 从分数版里删除一个队伍。 name must be an existing team.
scoreboard teams empty <name> 从分数版里删除队伍里所有的玩家。 The help text says that the subcommand is "clear", not "empty"; bug? name must be an existing team, and the team must have at least one player.
scoreboard teams join <team> [players...] 使某一个玩家加入某一个队伍。 如果不输入玩家则会让所有玩家加入 team 必须存在. 注:不在线的玩家也可以加进去,包括已经在队伍的玩家.
scoreboard teams leave [players...] 让某一个玩家退出队伍。 不输入玩家会直接让所有玩家退出该队伍 输入的玩家必须在队伍里 - it is possible to get a partial success and partial failure, but a command block will report only the failure.
scoreboard teams option <team> <color|friendlyfire|seeFriendlyInvisibles> <value> 队伍的设置的基础指令 N/A
scoreboard teams option <team> color <value> 这个指令会给所有在该队伍的玩家的名字上色或修改字体,上色的地方为:玩家头顶上显示的名字,玩家列表里的玩家名和侧边栏里的玩家名. 所有可用的颜色为:"black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", 和"white". Other valid values are"reset" (names show in default color and formatting), "obfuscated" (same as effect seen in obfuscated parts of the End Poem), 字体有:"bold"(粗体字), "strikethrough"(删除线), "underline"(下划线), and "italic"(斜体字). See Formatting Codes for information about how these will appear. team 必须存在, and value 必须是有效的数值.
scoreboard teams option <team> friendlyfire <true|false> The default setting,如果选择 true,则该队伍的玩家可以对打(PVP). 如果选择 false,则该队伍的玩家无法对打 , 弓和喷溅型的伤害药水仍然无效,但是其它药水仍然会给同队玩家附上相应的效果 team必须存在,并且只能输入"true"或者"false".
scoreboard teams option <team> seeFriendlyInvisibles <true|false> 如果选择true,则玩家将看不到同队的队友的名字(包括他们自己)但名字只是半透明,并不是完全隐形的 team 必须存在, 并且只能输入"true"或者"false".

NBT 格式

记分板数据存储在地图文件夹下的scoreboard.dat文件中,存储形式为GZip'dNBT格式

  • 根标签。
    •  data: 记分板数据、
      •  Objectives: 代表对象的复合标签列表。
        • 对象。
          •  CriteriaName: 该对象的判据。必须为以下四种之一:"虚拟环境 (dummy)", "死亡次数 (deathCount)", "杀敌数量 (playerKillCount)"以及"击杀数量 (totalKillCount)"。
          •  DisplayName: 对象的显示名称。如果在创建对象时没有涉及,则会与下文中名称标签相同。
          •  Name: 对象的内部名称
      •  PlayerScores: 在记分板系统中所追踪的分数的复合标签列表。
        • 拥有分数的玩家或对象。
          •  Score: 此对象中玩家的分数。
          •  Name: 对象中拥有此分数的玩家名称。
          •  Objective: 玩家分数所在对象的内部名称
      •  DisplaySlots: 正在显示的对象的显示模式。
        •  slot_0: 正在以"列表"模式显示的对象的内部名称
        •  slot_1: 正在以"侧边栏"模式显示的对象的内部名称

历史

u
13w04a添加记分板系统

画廊

游戏内容

Advertisement