本站文本内容除另有声明外,转载时均必须注明出处。(详情…本站文本内容除另有声明外,转载时均必须注明出处。(详情…中文Minecraft Wiki是完全公开的。请勇于扩充与修正内容!中文Minecraft Wiki是完全公开的。请勇于扩充与修正内容!Minecraft中文Wiki微博正在更新!或许有兴趣去看看Minecraft中文Wiki微博正在更新!或许有兴趣去看看想与其他用户进行编辑上的沟通?社区专页正是为此创建的。想与其他用户进行编辑上的沟通?社区专页正是为此创建的。翻译或创建页面之前,不妨看看译名标准化Wiki条例页面。翻译或创建页面之前,不妨看看译名标准化Wiki条例页面。需要管理员的协助?在管理员告示板留言也许可以帮到您。需要管理员的协助?在管理员告示板留言也许可以帮到您。

模块:Test

来自Minecraft Wiki
跳转至: 导航搜索
这是文档页面,它将被放置到主模块页。查看Template:Documentation以获取更多信息。
Minecraft Wiki沙盒

条目模板模块


这是中文Minecraft Wiki的公共沙盒。您可以在此页面上进行测试性编辑,但我们仍然建议在此处进行有建设性的编辑或翻译较短的条目。要编辑此页面,请点击上方的“编辑”铅笔按钮,或点击此处。在进行更改后,您可以点击编辑框下面的“显示预览”按钮来预览您的编辑,然后在相同位置点击“保存页面”按钮来保存编辑。

请注意,对此页面的更改不会长期保留,因为此页面只是用来测试编辑或翻译较短的条目的。如果您注册并登录了您的账号,可以创建此页面的子页面(例如,模块:Test/测试)来进行长期的项目,但它们仍然会在被社区认定为过期后被删除。任何不具建设性的内容随时都可能会被清理。另外,如果您已注册账号,可以在自己的个人页面下创建您的个人沙盒,并且不用担心您的编辑会被清理。

您在编辑包括本页面在内的所有Wiki页面时都必须遵守相关的Wiki条例格式指导书面汉语指导等要求,否则您的编辑会被回退,您也可能会遭到警告甚至封禁处理。若有任何疑问,请到讨论页社区专页提出。若需要联系管理员,请到管理员告示板提出请求。

参见:Chest loot

.base usage (Template:Test)[编辑源代码]

Generates a table of the contents of the designated chests, with columns corresponding to various statistics about the availability of those items.

Invoking[编辑源代码]

It takes any number of chest parameters, and any number of column parameters, in no particular order.

If no chest parameters are listed, it displays them all; likewise for column parameters.

{{#invoke:Test|base
 [ |<chestParam1> ... |<chestParamN> ]
 [ |<columnHideParam1> ... |<columnHideParamN> ]
}}

Chest parameters[编辑源代码]

bonus,
buried-treasure,
desert-temple ( desert ),
dungeon,
end-city,
igloo,
jungle-temple ( jungle ),
jungle-temple-dispenser,
mineshaft,
nether-fortress ( nether, fortress ),
pillager-outpost ( outpost ),
shipwreck-map,
shipwreck-supply,
shipwreck-treasure,
stronghold-altar ( altar ),
stronghold-library ( library ),
stronghold-storeroom ( storeroom ),
underwater-ruin-big,
underwater-ruin-small,
village-armorer ( armorer ),
village-blacksmith ( blacksmith ),
village-butcher ( butcher ),
village-cartographer ( cartographer ),
village-desert-house ( desert-house ),
village-mason ( mason ),
village-plains-house ( plains-house ),
village-savanna-house ( savanna-house ),
village-shepherd ( shepherd ),
village-snowy-house ( snowy-house ),
village-taiga-house ( taiga-house ),
village-tannery ( tannery ),
village-two-room-house,
village-weaponsmith ( weaponsmith ),
woodland-mansion ( mansion )

Column parameters[编辑源代码]

chance: 表示该物品在一个箱子里面出现的几率。,
chests: 预计为了该物品而要搜索的箱子的数量。,
items: 预计每个箱子里出现的物品数量,这个数值采用了许多箱子的数据进行平均而得出的。,
stacksize: 在这个箱子里能找到的物品一组的数量(对于不可堆叠的物品则为个数)。,
weight: 这个物品相对于箱子里面的其他物品的权重。

Example[编辑源代码]

{{#invoke:Test|base}} → all chests and all columns

{{#invoke:Test|base|blacksmith|jungle|bonus|chance|stacksize}} → only blacksmith and jungle chests, and only 'stacksize' and 'chance' columns

.base2 usage (Template:LootChestItem)[编辑源代码]

Prints a summary of this item's availability in the various worldgen chests.

Invoking[编辑源代码]

It takes exactly one item name as a parameter.

{{#invoke:Test|base2|<itemParam>}}

Item parameters[编辑源代码]

acacia-log, acacia-sapling, activator-rail, apple, arrow, bamboo, beef, beetroot, beetroot-seeds, beetroot-soup, birch-log, birch-sapling, black-wool, blue-ice, bone, book, book-and-quill, bottle-o'-enchanting, bread, brown-mushroom, brown-wool, bucket, buried-treasure-map, cactus, cake, carrot, chainmail-boots, chainmail-chestplate, chainmail-helmet, chainmail-leggings, clay, clock, coal, cocoa-beans, compass, cooked-cod, cooked-salmon, crossbow, dandelion, dark-oak-log, dark-oak-sapling, dead-bush, detector-rail, diamond, diamond-chestplate, diamond-hoe, diamond-horse-armor, emerald, empty, empty-map, enchanted-book, enchanted-book-rnd, enchanted-book-rnd-treasure, enchanted-diamond-boots, enchanted-diamond-chestplate, enchanted-diamond-helmet, enchanted-diamond-leggings, enchanted-diamond-pickaxe, enchanted-diamond-shovel, enchanted-diamond-sword, enchanted-fishing-rod, enchanted-golden-apple, enchanted-iron-boots, enchanted-iron-chestplate, enchanted-iron-helmet, enchanted-iron-leggings, enchanted-iron-pickaxe, enchanted-iron-shovel, enchanted-iron-sword, enchanted-leather-boots, enchanted-leather-cap, enchanted-leather-pants, enchanted-leather-tunic, ender-pearl, feather, fern, flint-and-steel, flower-pot, furnace, gold-ingot, gold-nugget, golden-apple, golden-chestplate, golden-helmet, golden-horse-armor, golden-sword, grass, gray-wool, green-dye, gunpowder, heart-of-the-sea, ink-sac, iron-boots, iron-chestplate, iron-helmet, iron-horse-armor, iron-ingot, iron-leggings, iron-nugget, iron-pickaxe, iron-sword, jungle-log, jungle-sapling, lapis-lazuli, large-fern, lead, leather, leather-boots, leather-cap, leather-pants, leather-tunic, light-gray-wool, melon-seeds, music-disc-13, music-disc-cat, music-disc-mellohi, music-disc-wait, name-tag, nether-wart, oak-log, oak-planks, oak-sapling, oak-wood-only, obsidian, paper, poisonous-potato, poppy, potato, potion-of-regeneration, potion-of-water-breathing, powered-rail, prismarine-crystals, pumpkin, pumpkin-pie, pumpkin-seeds, rail, raw-mutton, raw-porkchop, raw-salmon, redstone, rotten-flesh, saddle, sand, shears, smooth-stone, snow-block, snowball, spider-eye, spruce-log, spruce-sapling, spruce-sign, stick, stone, stone-axe, stone-bricks, stone-pickaxe, string, suspicious-stew, sweet-berries, tall-grass, tnt, torch, wheat, wheat-seeds, white-wool, wooden-axe, wooden-hoe, wooden-pickaxe, yellow-dye

Example[编辑源代码]

{{#invoke:Test|base2|iron-ingot}} → 铁锭有54.2%几率会在村庄盔甲匠的箱子里并且有30.5%几率会在掠夺者前哨站的箱子里以1–3个单独为一组的形式出现;有23.3%几率会在要塞祭坛的箱子里,有41.2%几率会在村庄工具匠的箱子里,有97.4%几率会在沉船宝箱的箱子里,有34.3%几率会在要塞储藏室的箱子里,有45.1%几率会在村庄武器匠的箱子里,有19.0%几率会在下界要塞的箱子里,有37.4%几率会在丛林神庙的箱子里,有18.0%几率会在沙漠神殿的箱子里,并且有31.6%几率会在废弃矿井运输矿车里,皆以1–5个单独为一组的形式出现;有38.4%几率会在末地城的箱子里以4–8个单独为一组的形式出现;以及有18.5%几率会在地牢的箱子里,有18.5%几率会在林地府邸的箱子里,并且有99.4%几率会在埋藏的宝藏的箱子里,皆以1–4个单独为一组的形式出现。

基岩版中,其有57.2%几率会在埋藏的宝藏的箱子里以3–5个单独为一组的形式出现,以及有22.6%几率会在要塞祭坛的箱子里,有28.5%几率会在要塞储藏室的箱子里,并且有37.3%几率会在丛林神庙的箱子里,皆以1–5个单独为一组的形式出现。

{{#invoke:Test|base2|emerald}} → 绿宝石有14.9%几率会在大型水下废墟的箱子里,有24.2%几率会在村庄渔夫的箱子里,有31.8%几率会在村庄盔甲匠的箱子里,有12.3%几率会在村庄牧羊人的箱子里,有10.2%几率会在村庄屠夫的箱子里,有16.4%几率会在小型水下废墟的箱子里,有12.3%几率会在村庄制箭师的箱子里,有7.6%几率会在雪屋的箱子里,并且有20.8%几率会在村庄石匠的箱子里,皆以1个单独为一组的形式出现;有25.4%几率会在村庄教堂的箱子里,有21.5%几率会在热带草原村庄房屋的箱子里,有9.9%几率会在雪域村庄房屋的箱子里,有22.8%几率会在平原村庄房屋的箱子里,有18.6%几率会在针叶林村庄房屋的箱子里,并且有17.3%几率会在村庄皮革厂的箱子里,皆以1–4个单独为一组的形式出现;有73.7%几率会在沉船宝箱的箱子里以1–5个单独为一组的形式出现;有53.1%几率会在埋藏的宝藏的箱子里以4–8个单独为一组的形式出现;有14.3%几率会在沙漠村庄房屋的箱子里,有8.7%几率会在丛林神庙的箱子里,并且有18.0%几率会在沙漠神殿的箱子里,皆以1–3个单独为一组的形式出现;以及有9.0%几率会在末地城的箱子里以2–6个单独为一组的形式出现。

基岩版中,其有7.2%几率会在要塞祭坛的箱子里并且有8.7%几率会在丛林神庙的箱子里以1–3个单独为一组的形式出现,以及有20.3%几率会在针叶林村庄房屋的箱子里以1–4个单独为一组的形式出现。

Source[编辑源代码]

  • The data is set up within p so that it can be pulled directly from (or compared directly to) the minecraft loot table files.
  • stack size given here (and given in code) can be larger than the stackable size of the item, prominently in the case of enchanted books. However this fact does not affect the calculated values. This is because the game puts the right number of items, but unstacked rather than stacked.

Data structure[编辑源代码]

  • p.items
'<item-id>' = {
This key must match a sprite name for the items/blocks defined in Module:BlockSprite or Module:ItemSprite, unless id is included in the item definition.
'<sprite-type>'
Either item or block.
[, id='<sprite-id>']
Use this to specify a sprite defined in Module:BlockSprite or Module:ItemSprite. Otherwise it will use the sprite with the name given by item-id.
[, link='<item-link>']
A link to a page that is different from the sprite-id name. Used in Template:Test.
[, title='<item-text>']
A name for an item that is different from the sprite-id name.
[, cannot_stack=false]
Use this to indicate that the item comes in groups rather than in stacks. Used in Template:LootChestItem.
[, plural=(false|'<custom-plural-word>')]
Use false when a word has no plural, like 'Nether Wart'. Use a custom plural word when you cannot simply append an 's' to the base word to make it plural, like 'Bottles o' Enchanting'. Used in Template:LootChestItem.
[, preserve_case=false]
Use false when an item name should follow the capitalization exactly specified in title, and not follow sentence case, like 'TNT'.
[, note='<note-name>']
Indicates that a note will appear next to this item in the table. (notes are defined directly below the item list)
}
  • p.notes
'<note-name>' = '<note-full-text>'
  • p.chests[n].pools[n]
  • p.chests[n].poolsDev[n]
    • rolls
{ <min-number-of-stacks>, <max-number-of-stacks> }
  • p.chests[n].pools[n].items
  • p.chests[n].poolsDev[n].items
'<item-id>' = { <min-stack-size>, <max-stack-size>, <item-weight> }
  • p.synonyms
'<chest-name-synonym>' = '<original-interally-valid-chest-name>'
Allows additional chest names to be used as parameters, in addition to the ones defined in p.chests.
  • p.display_names
'<chest-name-given-via-parameter>' = '<name-displayed-in-single-chest-table>'
If a single chest parameter is used, this defines the name it is called in the summary text above the table.
  • p.columns
'<column-name>' = '<column-full-description>'
The column descriptions, found either in the tooltip on the column header, or in the summary text above the table.

Functions[编辑源代码]

The following functions are made available at the top of the file, for ease of inspection.

  • calc_average_amount_this_item_per_chest
average number of a certain item (not number of stacks), per-chest (not per-structure).
  • calc_chance_any_of_this_item_per_chest
chance that at least one of a certain item will be found, per-chest (not per-structure).

Item tests[编辑源代码]

{{#invoke:Test|base2_test}}



TNT有9.5%概率会在沉船补给箱的箱子里并且有62.7%概率会在埋藏的宝藏的箱子里以1–2份为一组的形式出现。 在1.14中,其有8.1%概率会在沉船补给箱的箱子里以1–2份为一组的形式出现。

基岩版中,其有34.3%概率会在埋藏的宝藏的箱子里以1–2份为一组的形式出现。

丛林原木有28.0%概率会在奖励箱的箱子里以1–3份为一组的形式出现。

基岩版中,其有25.0%概率会在奖励箱的箱子里以1–3份为一组的形式出现。

书有89.2%概率会在要塞图书馆的箱子里以1–3份为一组的形式出现, 也会在有34.5%概率会在水下遗迹地图箱的箱子里以1–5份为一组的形式出现。 在1.14中,其有14.3%概率会在村庄房屋的箱子里以1份为一组的形式出现。

基岩版中,其有88.3%概率会在要塞图书馆的箱子里以1–3份为一组的形式出现。

云杉原木有28.0%概率会在奖励箱的箱子里以1–3份为一组的形式出现。 在1.14中,其有65.6%概率会在村庄房屋的箱子里以1–5份为一组的形式出现。

基岩版中,其有25.0%概率会在奖励箱的箱子里以1–3份为一组的形式出现。

充能铁轨有27.1%概率会在废弃矿井运输矿车里以1–4份为一组的形式出现。

南瓜有18.2%概率会在沉船补给箱的箱子里以1–3份为一组的形式出现。 在1.14中,其有15.6%概率会在沉船补给箱的箱子里以1–3份为一组的形式出现。

南瓜种子有18.5%概率会在地牢的箱子里,有31.6%概率会在废弃矿井运输矿车里,并且有18.5%概率会在林地府邸的箱子里,皆以2–4份为一组的形式出现。 在1.14中,其有40.6%概率会在村庄房屋的箱子里以1–5份为一组的形式出现。

基岩版中,其有33.3%概率会在奖励箱的箱子里以1–2份为一组的形式出现。

命名牌有28.3%概率会在地牢的箱子里,有42.3%概率会在废弃矿井运输矿车里,并且有28.3%概率会在林地府邸的箱子里,皆以1份为一组的形式出现。

基岩版中,其有27.9%概率会在林地府邸的箱子里并且有34.3%概率会在埋藏的宝藏的箱子里以1份为一组的形式出现。

1.14中,beef有48.6%概率会在村庄屠夫的箱子里以1–3份为一组的形式出现。

1.14中,suspicious stew[注 6]有57.4%概率会在沉船补给箱的箱子里以1份为一组的形式出现。

1.14中,云杉木告示牌有9.7%概率会在村庄房屋的箱子里以1份为一组的形式出现。

1.14中,云杉树苗有40.6%概率会在村庄房屋的箱子里以1–5份为一组的形式出现。

基岩版中,其有16.7%概率会在奖励箱的箱子里以4份为一组的形式出现。

1.14中,仙人掌有80.6%概率会在村庄房屋的箱子里以1–4份为一组的形式出现。

基岩版中,其有50.0%概率会在奖励箱的箱子里以1–2份为一组的形式出现。

1.14中,剪刀有12.3%概率会在村庄牧羊人的箱子里以1份单独为一组的形式出现。

1.14中,大型蕨有18.6%概率会在村庄房屋的箱子里以1份为一组的形式出现。

1.14中,小麦种子有71.7%概率会在村庄房屋的箱子里以1–5份为一组的形式出现。

基岩版中,其有55.1%概率会在村庄两室屋的箱子里以2–4份为一组的形式出现。

1.14中,平滑石头有20.8%概率会在村庄石匠的箱子里以1份为一组的形式出现。

1.14中,弩所有的掠夺者前哨站的箱子里以1份单独为一组的形式出现。

1.14中,枯萎的灌木有26.6%概率会在村庄房屋的箱子里以1–3份为一组的形式出现。

1.14中,棕色羊毛有23.3%概率会在村庄牧羊人的箱子里以1–3份为一组的形式出现。

1.14中,淡灰色羊毛有23.3%概率会在村庄牧羊人的箱子里以1–3份为一组的形式出现。

1.14中,灰色羊毛有23.3%概率会在村庄牧羊人的箱子里以1–3份为一组的形式出现。

1.14中,熔炉有9.9%概率会在村庄房屋的箱子里以1份为一组的形式出现。

1.14中,甜浆果有40.6%概率会在村庄房屋的箱子里以1–7份为一组的形式出现。

1.14中,甜菜汤有9.9%概率会在村庄房屋的箱子里以1份单独为一组的形式出现。

1.14中,生猪排有48.6%概率会在村庄屠夫的箱子里以1–3份为一组的形式出现。

1.14中,生羊肉有48.6%概率会在村庄屠夫的箱子里以1–3份为一组的形式出现。

1.14中,白色羊毛有55.8%概率会在村庄牧羊人的箱子里以1–8份为一组的形式出现。

1.14中,皮革帽子有31.8%概率会在村庄皮革厂的箱子里以1份单独为一组的形式出现。

1.14中,皮革有17.3%概率会在村庄皮革厂的箱子里以1–3份为一组的形式出现。

1.14中,皮革裤子有31.8%概率会在村庄皮革厂的箱子里以1份单独为一组的形式出现。

1.14中,皮革靴子有31.8%概率会在村庄皮革厂的箱子里以1份单独为一组的形式出现。

1.14中,石头有37.7%概率会在村庄石匠的箱子里以1份为一组的形式出现。

1.14中,石砖有37.7%概率会在村庄石匠的箱子里以1份为一组的形式出现。

1.14中,竹子有15.6%概率会在沉船补给箱的箱子里并且有51.0%概率会在丛林神庙的箱子里以1–3份为一组的形式出现。

基岩版中,其有50.9%概率会在丛林神庙的箱子里以1–3份为一组的形式出现。

1.14中,粘土有14.3%概率会在村庄房屋的箱子里以1份为一组的形式出现, 也会在有20.8%概率会在村庄石匠的箱子里以1–3份为一组的形式出现。

1.14中,绿色染料有14.3%概率会在村庄房屋的箱子里以1份为一组的形式出现。

1.14中,花盆有20.8%概率会在村庄石匠的箱子里以1份为一组的形式出现。

1.14中,草有45.9%概率会在村庄房屋的箱子里以1份为一组的形式出现。

1.14中,蒲公英有12.9%概率会在村庄房屋的箱子里以1份为一组的形式出现。

1.14中,蓝冰有9.9%概率会在村庄房屋的箱子里以1份为一组的形式出现。

1.14中,蕨有18.6%概率会在村庄房屋的箱子里以1份为一组的形式出现。

1.14中,虞美人有12.9%概率会在村庄房屋的箱子里以1份为一组的形式出现。

1.14中,金合欢树苗有71.7%概率会在村庄房屋的箱子里以1–2份为一组的形式出现。

基岩版中,其有16.7%概率会在奖励箱的箱子里以4份为一组的形式出现。

1.14中,雪块有34.5%概率会在村庄房屋的箱子里以1份为一组的形式出现。

1.14中,雪球有66.3%概率会在村庄房屋的箱子里以1–7份为一组的形式出现。

1.14中,高草丛有45.9%概率会在村庄房屋的箱子里以1份为一组的形式出现。

1.14中,黄色染料有20.8%概率会在村庄石匠的箱子里以1份为一组的形式出现。

1.14中,黑色羊毛有33.0%概率会在村庄牧羊人的箱子里以1–3份为一组的形式出现。

基岩版中,丛林树苗有16.7%概率会在奖励箱的箱子里以4份为一组的形式出现。

基岩版中,书与笔有18.9%概率会在埋藏的宝藏的箱子里以1–2份为一组的形式出现。

基岩版中,再生药水有34.3%概率会在埋藏的宝藏的箱子里以1份为一组的形式出现。

基岩版中,可可豆有50.0%概率会在奖励箱的箱子里以1–2份为一组的形式出现。

基岩版中,墨囊有40.0%概率会在要塞储藏室的箱子里以1–3份为一组的形式出现。

基岩版中,木锄有14.2%概率会在村庄两室屋的箱子里以1份单独为一组的形式出现。

基岩版中,棕色蘑菇所有的奖励箱的箱子里以1–2份为一组的形式出现。

基岩版中,水肺药水有46.9%概率会在埋藏的宝藏的箱子里以1份为一组的形式出现。

基岩版中,深色橡树树苗有16.7%概率会在奖励箱的箱子里以4份为一组的形式出现。

基岩版中,甜菜根有55.1%概率会在村庄两室屋的箱子里以5–8份为一组的形式出现。

基岩版中,白桦树苗有16.7%概率会在奖励箱的箱子里以4份为一组的形式出现。

基岩版中,蛋糕有4.1%概率会在埋藏的宝藏的箱子里以1份为一组的形式出现。

基岩版中,锁链头盔有57.2%概率会在埋藏的宝藏的箱子里以1份单独为一组的形式出现。

基岩版中,锁链护腿有57.2%概率会在埋藏的宝藏的箱子里以1份单独为一组的形式出现。

基岩版中,锁链靴子有57.2%概率会在埋藏的宝藏的箱子里以1份单独为一组的形式出现。

基岩版中,附魔书[注 1]有17.5%概率会在林地府邸的箱子里以1份单独为一组的形式出现。

基岩版中,音乐唱片(mellohi)有18.9%概率会在埋藏的宝藏的箱子里以1份单独为一组的形式出现。

基岩版中,音乐唱片(wait)有18.9%概率会在埋藏的宝藏的箱子里以1份单独为一组的形式出现。

地狱疣有19.0%概率会在下界要塞的箱子里以3–7份为一组的形式出现。

小麦有34.1%概率会在地牢的箱子里并且有34.1%概率会在林地府邸的箱子里以1–4份为一组的形式出现, 有50.7%概率会在沉船补给箱的箱子里以8–21份为一组的形式出现, 也会在有81.0%概率会在大型水下遗迹的箱子里,有84.2%概率会在小型水下遗迹的箱子里,并且有55.3%概率会在雪屋的箱子里,皆以2–3份为一组的形式出现。 在1.14中,其有80.6%概率会在村庄房屋的箱子里以1–7份为一组的形式出现, 有72.5%概率会在掠夺者前哨站的箱子里以3–5份为一组的形式出现, 有44.9%概率会在沉船补给箱的箱子里以8–21份为一组的形式出现, 有48.6%概率会在村庄屠夫的箱子里以1–3份为一组的形式出现, 也会在有55.8%概率会在村庄牧羊人的箱子里以1–6份为一组的形式出现。

基岩版中,其有93.4%概率会在村庄两室屋的箱子里以8–12份为一组的形式出现。

打火石有19.0%概率会在下界要塞的箱子里以1份单独为一组的形式出现。

拴绳有28.3%概率会在林地府邸的箱子里以1份为一组的形式出现。

基岩版中,其有27.9%概率会在林地府邸的箱子里以1份为一组的形式出现, 也会在有34.3%概率会在埋藏的宝藏的箱子里以1–3份为一组的形式出现。

指南针有7.7%概率会在水下遗迹地图箱的箱子里并且有10.9%概率会在要塞图书馆的箱子里以1份为一组的形式出现。 在1.14中,其有26.3%概率会在村庄制图师的箱子里以1份为一组的形式出现。

基岩版中,其有10.5%概率会在要塞图书馆的箱子里以1份为一组的形式出现。

探测铁轨有27.1%概率会在废弃矿井运输矿车里以1–4份为一组的形式出现。

[注 5]有18.0%概率会在沙漠神殿的箱子里并且有7.0%概率会在废弃矿井运输矿车里以1份为一组的形式出现。

时钟有7.7%概率会在水下遗迹地图箱的箱子里以1份为一组的形式出现。

木斧有75.0%概率会在奖励箱的箱子里以1份单独为一组的形式出现。

木棍有70.5%概率会在奖励箱的箱子里以1–12份为一组的形式出现。

基岩版中,其所有的奖励箱的箱子里以1–12份为一组的形式出现。

木镐有75.0%概率会在奖励箱的箱子里以1份单独为一组的形式出现。

末影珍珠有23.3%概率会在要塞祭坛的箱子里以1份为一组的形式出现。

基岩版中,其有22.6%概率会在要塞祭坛的箱子里以1份为一组的形式出现。

桶有18.5%概率会在地牢的箱子里并且有18.5%概率会在林地府邸的箱子里以1份为一组的形式出现。 在1.14中,其有11.3%概率会在村庄房屋的箱子里以1份为一组的形式出现。

橡木原木有28.0%概率会在奖励箱的箱子里以1–3份为一组的形式出现。

基岩版中,其有25.0%概率会在奖励箱的箱子里以1–3份为一组的形式出现。

橡木木板有70.5%概率会在奖励箱的箱子里以1–12份为一组的形式出现。

基岩版中,其所有的奖励箱的箱子里以1–12份为一组的形式出现。

橡树树苗有25.6%概率会在村庄铁匠的箱子里以3–7份为一组的形式出现。 在1.14中,其有26.3%概率会在村庄制图师的箱子里并且有50.8%概率会在村庄房屋的箱子里以1–2份为一组的形式出现, 也会在有25.6%概率会在村庄武器匠的箱子里以3–7份为一组的形式出现。

基岩版中,其有16.7%概率会在奖励箱的箱子里以4份为一组的形式出现。

毒马铃薯有50.7%概率会在沉船补给箱的箱子里以2–6份为一组的形式出现。 在1.14中,其有44.9%概率会在沉船补给箱的箱子里以2–6份为一组的形式出现。

沙子有59.0%概率会在沙漠神殿的箱子里以1–8份为一组的形式出现。

海晶砂粒有53.1%概率会在埋藏的宝藏的箱子里以1–5份为一组的形式出现。

基岩版中,其有18.9%概率会在埋藏的宝藏的箱子里以1–5份为一组的形式出现。

海洋之心所有的埋藏的宝藏的箱子里以1份为一组的形式出现。

深色橡木原木有28.0%概率会在奖励箱的箱子里以1–3份为一组的形式出现。 在1.14中,其所有的掠夺者前哨站的箱子里以2–3份为一组的形式出现。

基岩版中,其有50.0%概率会在奖励箱的箱子里以1–3份为一组的形式出现。

激活铁轨有27.1%概率会在废弃矿井运输矿车里以1–4份为一组的形式出现。

火把有65.7%概率会在废弃矿井运输矿车里以1–16份为一组的形式出现。 在1.14中,其有11.3%概率会在村庄房屋的箱子里以1–2份为一组的形式出现。

火药有26.0%概率会在沉船补给箱的箱子里以1–5份为一组的形式出现, 也会在有57.8%概率会在地牢的箱子里,有59.0%概率会在沙漠神殿的箱子里,并且有57.8%概率会在林地府邸的箱子里,皆以1–8份为一组的形式出现。 在1.14中,其有22.4%概率会在沉船补给箱的箱子里以1–5份为一组的形式出现。

煤炭有81.0%概率会在大型水下遗迹的箱子里,有84.2%概率会在小型水下遗迹的箱子里,有26.6%概率会在地牢的箱子里,有70.4%概率会在雪屋的箱子里,并且有26.6%概率会在林地府邸的箱子里,皆以1–4份为一组的形式出现;有45.4%概率会在沉船补给箱的箱子里以2–8份为一组的形式出现;也会在有34.3%概率会在要塞储藏室的箱子里并且有31.6%概率会在废弃矿井运输矿车里以3–8份为一组的形式出现。 在1.14中,其有41.2%概率会在村庄房屋的箱子里以1–4份为一组的形式出现, 有40.0%概率会在沉船补给箱的箱子里以2–8份为一组的形式出现, 也会在有27.9%概率会在村庄屠夫的箱子里以1–3份为一组的形式出现。

基岩版中,其有28.5%概率会在要塞储藏室的箱子里以3–8份为一组的形式出现。

熟鲑鱼有75.0%概率会在埋藏的宝藏的箱子里以2–4份为一组的形式出现。

熟鳕鱼有75.0%概率会在埋藏的宝藏的箱子里以2–4份为一组的形式出现。

甜菜种子有21.2%概率会在末地城的箱子里以1–10份为一组的形式出现, 也会在有18.5%概率会在地牢的箱子里,有31.6%概率会在废弃矿井运输矿车里,并且有18.5%概率会在林地府邸的箱子里,皆以2–4份为一组的形式出现。 在1.14中,其有66.3%概率会在村庄房屋的箱子里以1–5份为一组的形式出现。

基岩版中,其有33.3%概率会在奖励箱的箱子里以1–2份为一组的形式出现。

生鲑鱼有61.5%概率会在奖励箱的箱子里以1–2份为一组的形式出现。

基岩版中,其所有的奖励箱的箱子里以1–2份为一组的形式出现。

白桦原木有28.0%概率会在奖励箱的箱子里以1–3份为一组的形式出现。

基岩版中,其有25.0%概率会在奖励箱的箱子里以1–3份为一组的形式出现。

皮革外套有4.3%概率会在大型水下遗迹的箱子里,有8.3%概率会在小型水下遗迹的箱子里,并且有75.0%概率会在埋藏的宝藏的箱子里,皆以1份单独为一组的形式出现。 在1.14中,其有31.8%概率会在村庄皮革厂的箱子里以1份单独为一组的形式出现。

石斧有30.2%概率会在小型水下遗迹的箱子里,有14.7%概率会在雪屋的箱子里,并且有25.0%概率会在奖励箱的箱子里,皆以1份单独为一组的形式出现。

石镐有25.0%概率会在奖励箱的箱子里以1份单独为一组的形式出现。

空地图有7.7%概率会在水下遗迹地图箱的箱子里并且有10.9%概率会在要塞图书馆的箱子里以1份为一组的形式出现。 在1.14中,其有46.2%概率会在村庄制图师的箱子里以1–3份为一组的形式出现。

基岩版中,其有10.5%概率会在要塞图书馆的箱子里以1份为一组的形式出现。

箭所有的丛林神庙发射器里以2–7份为一组的形式出现。 在1.14中,其有39.1%概率会在掠夺者前哨站的箱子里以2–7份为一组的形式出现。

红石粉有26.6%概率会在地牢的箱子里并且有26.6%概率会在林地府邸的箱子里以1–4份为一组的形式出现, 也会在有12.1%概率会在要塞祭坛的箱子里,有18.6%概率会在要塞储藏室的箱子里,并且有16.9%概率会在废弃矿井运输矿车里,皆以4–9份为一组的形式出现。

基岩版中,其有11.8%概率会在要塞祭坛的箱子里并且有15.2%概率会在要塞储藏室的箱子里以4–9份为一组的形式出现。

纸有55.5%概率会在沉船补给箱的箱子里以1–12份为一组的形式出现, 有89.4%概率会在水下遗迹地图箱的箱子里以1–10份为一组的形式出现, 也会在有89.2%概率会在要塞图书馆的箱子里以2–7份为一组的形式出现。 在1.14中,其有49.4%概率会在沉船补给箱的箱子里以1–12份为一组的形式出现, 也会在有61.2%概率会在村庄制图师的箱子里以1–5份为一组的形式出现。

基岩版中,其有88.3%概率会在要塞图书馆的箱子里以2–7份为一组的形式出现。

线有57.8%概率会在地牢的箱子里,有59.0%概率会在沙漠神殿的箱子里,并且有57.8%概率会在林地府邸的箱子里,皆以1–8份为一组的形式出现。 在1.14中,其有39.1%概率会在掠夺者前哨站的箱子里以1–6份为一组的形式出现。

绿宝石有14.9%概率会在大型水下遗迹的箱子里,有16.4%概率会在小型水下遗迹的箱子里,并且有7.6%概率会在雪屋的箱子里,皆以1份为一组的形式出现;有18.0%概率会在沙漠神殿的箱子里并且有10.4%概率会在丛林神庙的箱子里以1–3份为一组的形式出现;有73.7%概率会在沉船宝箱的箱子里以1–5份为一组的形式出现;有53.1%概率会在埋藏的宝藏的箱子里以4–8份为一组的形式出现;也会在有9.0%概率会在末地城的箱子里以2–6份为一组的形式出现。 在1.14中,其有31.8%概率会在村庄盔甲商的箱子里,有12.3%概率会在村庄牧羊人的箱子里,有10.2%概率会在村庄屠夫的箱子里,并且有20.8%概率会在村庄石匠的箱子里,皆以1份为一组的形式出现;有14.3%概率会在村庄房屋的箱子里并且有8.7%概率会在丛林神庙的箱子里以1–3份为一组的形式出现;也会在有21.5%概率会在村庄房屋的箱子里,有9.9%概率会在村庄房屋的箱子里,有24.3%概率会在村庄房屋的箱子里,有18.6%概率会在村庄房屋的箱子里,并且有17.3%概率会在村庄皮革厂的箱子里,皆以1–4份为一组的形式出现。

基岩版中,其有7.2%概率会在要塞祭坛的箱子里并且有8.7%概率会在丛林神庙的箱子里以1–3份为一组的形式出现。

羽毛有60.0%概率会在水下遗迹地图箱的箱子里以1–5份为一组的形式出现。

胡萝卜有50.7%概率会在沉船补给箱的箱子里以4–8份为一组的形式出现。 在1.14中,其有44.9%概率会在沉船补给箱的箱子里以4–8份为一组的形式出现, 也会在有57.5%概率会在掠夺者前哨站的箱子里以3–5份为一组的形式出现。

基岩版中,其有81.7%概率会在村庄两室屋的箱子里以4–8份为一组的形式出现, 也会在有50.0%概率会在奖励箱的箱子里以1–2份为一组的形式出现。

腐肉有59.6%概率会在小型水下遗迹的箱子里并且有55.3%概率会在雪屋的箱子里以1份为一组的形式出现;有57.8%概率会在地牢的箱子里,有59.0%概率会在沙漠神殿的箱子里,并且有57.8%概率会在林地府邸的箱子里,皆以1–8份为一组的形式出现;有39.6%概率会在沉船补给箱的箱子里以5–24份为一组的形式出现;也会在有28.7%概率会在沙漠神殿的箱子里并且有60.5%概率会在丛林神庙的箱子里以3–7份为一组的形式出现。 在1.14中,其有53.4%概率会在丛林神庙的箱子里以3–7份为一组的形式出现, 也会在有34.6%概率会在沉船补给箱的箱子里以5–24份为一组的形式出现。

基岩版中,其有53.3%概率会在丛林神庙的箱子里以3–7份为一组的形式出现。

苹果有33.5%概率会在要塞祭坛的箱子里,有47.5%概率会在要塞储藏室的箱子里,有59.8%概率会在村庄铁匠的箱子里,并且有70.4%概率会在雪屋的箱子里,皆以1–3份为一组的形式出现;也会在有83.8%概率会在奖励箱的箱子里以1–2份为一组的形式出现。 在1.14中,其有59.8%概率会在村庄武器匠的箱子里以1–3份为一组的形式出现, 也会在有76.9%概率会在村庄房屋的箱子里以1–5份为一组的形式出现。

基岩版中,其有32.5%概率会在要塞祭坛的箱子里并且有40.0%概率会在要塞储藏室的箱子里以1–3份为一组的形式出现, 也会在所有的奖励箱的箱子里以1–2份为一组的形式出现。

藏宝图有43.5%概率会在大型水下遗迹的箱子里,有41.7%概率会在小型水下遗迹的箱子里,并且所有的水下遗迹地图箱的箱子里,皆以1份为一组的形式出现。

蜘蛛眼有28.7%概率会在沙漠神殿的箱子里以1–3份为一组的形式出现。

西瓜种子有18.5%概率会在地牢的箱子里,有31.6%概率会在废弃矿井运输矿车里,并且有18.5%概率会在林地府邸的箱子里,皆以2–4份为一组的形式出现。

基岩版中,其有33.3%概率会在奖励箱的箱子里以1–2份为一组的形式出现。

金剑有19.0%概率会在下界要塞的箱子里以1份单独为一组的形式出现。

金合欢原木有28.0%概率会在奖励箱的箱子里以1–3份为一组的形式出现。

基岩版中,其有50.0%概率会在奖励箱的箱子里以1–3份为一组的形式出现。

金头盔有4.3%概率会在大型水下遗迹的箱子里并且有8.3%概率会在小型水下遗迹的箱子里以1份单独为一组的形式出现。

金粒有81.0%概率会在大型水下遗迹的箱子里并且有55.3%概率会在雪屋的箱子里以1–3份为一组的形式出现, 也会在有36.6%概率会在沉船宝箱的箱子里以1–10份为一组的形式出现。 在1.14中,其有11.3%概率会在村庄房屋的箱子里并且有12.9%概率会在村庄房屋的箱子里以1–3份为一组的形式出现。

金胸甲有19.0%概率会在下界要塞的箱子里以1份单独为一组的形式出现。

金苹果有2.5%概率会在要塞祭坛的箱子里,有4.3%概率会在大型水下遗迹的箱子里,有21.8%概率会在地牢的箱子里,所有的雪屋的箱子里,有23.5%概率会在沙漠神殿的箱子里,有28.2%概率会在废弃矿井运输矿车里,并且有21.8%概率会在林地府邸的箱子里,皆以1份为一组的形式出现。

基岩版中,其有2.4%概率会在要塞祭坛的箱子里并且有21.5%概率会在林地府邸的箱子里以1份为一组的形式出现。

金锭有12.1%概率会在要塞祭坛的箱子里,有18.6%概率会在要塞储藏室的箱子里,有25.6%概率会在村庄铁匠的箱子里,有49.0%概率会在下界要塞的箱子里,并且有16.9%概率会在废弃矿井运输矿车里,皆以1–3份为一组的形式出现;有26.5%概率会在沉船宝箱的箱子里以1–5份为一组的形式出现;有18.0%概率会在沙漠神殿的箱子里,有58.0%概率会在丛林神庙的箱子里,并且有52.3%概率会在末地城的箱子里,皆以2–7份为一组的形式出现;也会在有9.6%概率会在地牢的箱子里,有9.6%概率会在林地府邸的箱子里,并且有88.0%概率会在埋藏的宝藏的箱子里,皆以1–4份为一组的形式出现。 在1.14中,其有25.6%概率会在村庄武器匠的箱子里以1–3份为一组的形式出现, 也会在有51.0%概率会在丛林神庙的箱子里以2–7份为一组的形式出现。

基岩版中,其有11.8%概率会在要塞祭坛的箱子里并且有15.2%概率会在要塞储藏室的箱子里以1–3份为一组的形式出现, 有34.3%概率会在埋藏的宝藏的箱子里以1–5份为一组的形式出现, 也会在有50.9%概率会在丛林神庙的箱子里以2–7份为一组的形式出现。

金马铠有2.5%概率会在要塞祭坛的箱子里,有5.7%概率会在村庄铁匠的箱子里,有14.9%概率会在地牢的箱子里,有12.3%概率会在沙漠神殿的箱子里,有5.3%概率会在丛林神庙的箱子里,有29.1%概率会在下界要塞的箱子里,并且有4.6%概率会在末地城的箱子里,皆以1份单独为一组的形式出现。 在1.14中,其有5.7%概率会在村庄武器匠的箱子里并且有4.5%概率会在丛林神庙的箱子里以1份单独为一组的形式出现。

基岩版中,其有2.4%概率会在要塞祭坛的箱子里并且有4.4%概率会在丛林神庙的箱子里以1份单独为一组的形式出现。

钻石有14.1%概率会在沉船宝箱的箱子里以1份为一组的形式出现;有7.4%概率会在要塞祭坛的箱子里,有16.2%概率会在村庄铁匠的箱子里,有6.3%概率会在沙漠神殿的箱子里,有15.3%概率会在丛林神庙的箱子里,并且有19.0%概率会在下界要塞的箱子里,皆以1–3份为一组的形式出现;有10.4%概率会在废弃矿井运输矿车里并且有53.1%概率会在埋藏的宝藏的箱子里以1–2份为一组的形式出现;也会在有21.2%概率会在末地城的箱子里以2–7份为一组的形式出现。 在1.14中,其有16.2%概率会在村庄武器匠的箱子里并且有12.9%概率会在丛林神庙的箱子里以1–3份为一组的形式出现。

基岩版中,其有46.9%概率会在埋藏的宝藏的箱子里以1份为一组的形式出现, 也会在有7.2%概率会在要塞祭坛的箱子里并且有12.8%概率会在丛林神庙的箱子里以1–3份为一组的形式出现。

钻石胸甲有7.7%概率会在林地府邸的箱子里以1份单独为一组的形式出现。

基岩版中,其有7.6%概率会在林地府邸的箱子里以1份单独为一组的形式出现。

钻石锄有21.8%概率会在林地府邸的箱子里以1份单独为一组的形式出现。

基岩版中,其有21.5%概率会在林地府邸的箱子里以1份单独为一组的形式出现。

钻石马铠有2.5%概率会在要塞祭坛的箱子里,有5.7%概率会在村庄铁匠的箱子里,有7.7%概率会在地牢的箱子里,有6.3%概率会在沙漠神殿的箱子里,有5.3%概率会在丛林神庙的箱子里,有11.8%概率会在下界要塞的箱子里,并且有4.6%概率会在末地城的箱子里,皆以1份单独为一组的形式出现。 在1.14中,其有5.7%概率会在村庄武器匠的箱子里并且有4.5%概率会在丛林神庙的箱子里以1份单独为一组的形式出现。

基岩版中,其有2.4%概率会在要塞祭坛的箱子里并且有4.4%概率会在丛林神庙的箱子里以1份单独为一组的形式出现。

铁剑有12.1%概率会在要塞祭坛的箱子里,有25.6%概率会在村庄铁匠的箱子里,并且有75.0%概率会在埋藏的宝藏的箱子里,皆以1份单独为一组的形式出现。 在1.14中,其有25.6%概率会在村庄武器匠的箱子里以1份单独为一组的形式出现。

基岩版中,其有11.8%概率会在要塞祭坛的箱子里以1份单独为一组的形式出现。

铁头盔有12.1%概率会在要塞祭坛的箱子里并且有25.6%概率会在村庄铁匠的箱子里以1份单独为一组的形式出现。 在1.14中,其有31.8%概率会在村庄盔甲商的箱子里并且有25.6%概率会在村庄武器匠的箱子里以1份单独为一组的形式出现。

基岩版中,其有11.8%概率会在要塞祭坛的箱子里以1份单独为一组的形式出现。

铁护腿有12.1%概率会在要塞祭坛的箱子里并且有25.6%概率会在村庄铁匠的箱子里以1份单独为一组的形式出现。 在1.14中,其有25.6%概率会在村庄武器匠的箱子里以1份单独为一组的形式出现。

基岩版中,其有11.8%概率会在要塞祭坛的箱子里以1份单独为一组的形式出现。

铁粒有94.5%概率会在沉船宝箱的箱子里以1–10份为一组的形式出现。 在1.14中,其有9.7%概率会在村庄房屋的箱子里以1–5份为一组的形式出现。

铁胸甲有12.1%概率会在要塞祭坛的箱子里并且有25.6%概率会在村庄铁匠的箱子里以1份单独为一组的形式出现。 在1.14中,其有25.6%概率会在村庄武器匠的箱子里以1份单独为一组的形式出现。

基岩版中,其有11.8%概率会在要塞祭坛的箱子里以1份单独为一组的形式出现。

铁轨有78.4%概率会在废弃矿井运输矿车里以4–8份为一组的形式出现。

铁锭有18.5%概率会在地牢的箱子里,有18.5%概率会在林地府邸的箱子里,并且有99.4%概率会在埋藏的宝藏的箱子里,皆以1–4份为一组的形式出现;有23.3%概率会在要塞祭坛的箱子里,有97.4%概率会在沉船宝箱的箱子里,有34.3%概率会在要塞储藏室的箱子里,有45.1%概率会在村庄铁匠的箱子里,有18.0%概率会在沙漠神殿的箱子里,有43.3%概率会在丛林神庙的箱子里,有19.0%概率会在下界要塞的箱子里,并且有31.6%概率会在废弃矿井运输矿车里,皆以1–5份为一组的形式出现;也会在有38.4%概率会在末地城的箱子里以4–8份为一组的形式出现。 在1.14中,其有54.2%概率会在村庄盔甲商的箱子里并且有30.5%概率会在掠夺者前哨站的箱子里以1–3份为一组的形式出现, 也会在有45.1%概率会在村庄武器匠的箱子里并且有37.4%概率会在丛林神庙的箱子里以1–5份为一组的形式出现。

基岩版中,其有57.2%概率会在埋藏的宝藏的箱子里以3–5份为一组的形式出现, 也会在有22.6%概率会在要塞祭坛的箱子里,有28.5%概率会在要塞储藏室的箱子里,并且有37.3%概率会在丛林神庙的箱子里,皆以1–5份为一组的形式出现。

铁镐有12.1%概率会在要塞祭坛的箱子里,有4.0%概率会在要塞储藏室的箱子里,有25.6%概率会在村庄铁匠的箱子里,并且有7.0%概率会在废弃矿井运输矿车里,皆以1份单独为一组的形式出现。 在1.14中,其有25.6%概率会在村庄武器匠的箱子里以1份单独为一组的形式出现。

基岩版中,其有11.8%概率会在要塞祭坛的箱子里并且有3.2%概率会在要塞储藏室的箱子里以1份单独为一组的形式出现。

铁靴子有12.1%概率会在要塞祭坛的箱子里并且有25.6%概率会在村庄铁匠的箱子里以1份单独为一组的形式出现。 在1.14中,其有25.6%概率会在村庄武器匠的箱子里以1份单独为一组的形式出现。

基岩版中,其有11.8%概率会在要塞祭坛的箱子里以1份单独为一组的形式出现。

铁马铠有2.5%概率会在要塞祭坛的箱子里,有5.7%概率会在村庄铁匠的箱子里,有21.8%概率会在地牢的箱子里,有18.0%概率会在沙漠神殿的箱子里,有5.3%概率会在丛林神庙的箱子里,有19.0%概率会在下界要塞的箱子里,并且有4.6%概率会在末地城的箱子里,皆以1份单独为一组的形式出现。 在1.14中,其有5.7%概率会在村庄武器匠的箱子里并且有4.5%概率会在丛林神庙的箱子里以1份单独为一组的形式出现。

基岩版中,其有2.4%概率会在要塞祭坛的箱子里并且有4.4%概率会在丛林神庙的箱子里以1份单独为一组的形式出现。

锁链胸甲有14.9%概率会在林地府邸的箱子里以1份单独为一组的形式出现。

基岩版中,其有14.7%概率会在林地府邸的箱子里并且有57.2%概率会在埋藏的宝藏的箱子里以1份单独为一组的形式出现。

附魔之瓶有14.1%概率会在沉船宝箱的箱子里以1份为一组的形式出现。 在1.14中,其有60.9%概率会在掠夺者前哨站的箱子里以1份为一组的形式出现。

基岩版中,其有11.8%概率会在埋藏的宝藏的箱子里以1份为一组的形式出现。

附魔书[注 3]有2.5%概率会在要塞祭坛的箱子里,有4.0%概率会在要塞储藏室的箱子里,有67.8%概率会在要塞图书馆的箱子里,并且有5.3%概率会在丛林神庙的箱子里,皆以1份单独为一组的形式出现。 在1.14中,其有4.5%概率会在丛林神庙的箱子里以1份单独为一组的形式出现。

基岩版中,其有2.9%概率会在要塞祭坛的箱子里,有3.8%概率会在要塞储藏室的箱子里,有72.9%概率会在要塞图书馆的箱子里,并且有5.3%概率会在丛林神庙的箱子里,皆以1份单独为一组的形式出现。

附魔书[注 4]有21.7%概率会在大型水下遗迹的箱子里,有14.9%概率会在地牢的箱子里,有23.5%概率会在沙漠神殿的箱子里,有14.1%概率会在废弃矿井运输矿车里,并且有14.9%概率会在林地府邸的箱子里,皆以1份单独为一组的形式出现。 在1.14中,其有11.0%概率会在掠夺者前哨站的箱子里以1份单独为一组的形式出现。

附魔的皮革外套[注 4]有26.0%概率会在沉船补给箱的箱子里以1份单独为一组的形式出现。 在1.14中,其有22.4%概率会在沉船补给箱的箱子里以1份单独为一组的形式出现。

附魔的皮革帽子[注 4]有26.0%概率会在沉船补给箱的箱子里以1份单独为一组的形式出现。 在1.14中,其有22.4%概率会在沉船补给箱的箱子里以1份单独为一组的形式出现。

附魔的皮革裤子[注 4]有26.0%概率会在沉船补给箱的箱子里以1份单独为一组的形式出现。 在1.14中,其有22.4%概率会在沉船补给箱的箱子里以1份单独为一组的形式出现。

附魔的皮革靴子[注 4]有26.0%概率会在沉船补给箱的箱子里以1份单独为一组的形式出现。 在1.14中,其有22.4%概率会在沉船补给箱的箱子里以1份单独为一组的形式出现。

附魔的钓鱼竿[注 4]有21.7%概率会在大型水下遗迹的箱子里并且有41.7%概率会在小型水下遗迹的箱子里以1份单独为一组的形式出现。

附魔的钻石[注 2]有13.3%概率会在末地城的箱子里以1份单独为一组的形式出现。

附魔的钻石剑[注 2]有13.3%概率会在末地城的箱子里以1份单独为一组的形式出现。

附魔的钻石头盔[注 2]有13.3%概率会在末地城的箱子里以1份单独为一组的形式出现。

附魔的钻石护腿[注 2]有13.3%概率会在末地城的箱子里以1份单独为一组的形式出现。

附魔的钻石胸甲[注 2]有13.3%概率会在末地城的箱子里以1份单独为一组的形式出现。

附魔的钻石锹[注 2]有13.3%概率会在末地城的箱子里以1份单独为一组的形式出现。

附魔的钻石靴子[注 2]有13.3%概率会在末地城的箱子里以1份单独为一组的形式出现。

附魔的铁剑[注 2]有13.3%概率会在末地城的箱子里以1份单独为一组的形式出现。

附魔的铁头盔[注 2]有13.3%概率会在末地城的箱子里以1份单独为一组的形式出现。

附魔的铁护腿[注 2]有13.3%概率会在末地城的箱子里以1份单独为一组的形式出现。

附魔的铁胸甲[注 2]有13.3%概率会在末地城的箱子里以1份单独为一组的形式出现。

附魔的铁锹[注 2]有13.3%概率会在末地城的箱子里以1份单独为一组的形式出现。

附魔的铁镐[注 2]有13.3%概率会在末地城的箱子里以1份单独为一组的形式出现。

附魔的铁靴子[注 2]有13.3%概率会在末地城的箱子里以1份单独为一组的形式出现。

附魔金苹果有3.1%概率会在地牢的箱子里,有2.6%概率会在沙漠神殿的箱子里,有1.4%概率会在废弃矿井运输矿车里,并且有3.1%概率会在林地府邸的箱子里,皆以1份为一组的形式出现。

基岩版中,其有3.1%概率会在林地府邸的箱子里以1份为一组的形式出现。

青金石有16.9%概率会在废弃矿井运输矿车里以4–9份为一组的形式出现, 也会在有61.5%概率会在沉船宝箱的箱子里以1–10份为一组的形式出现。

面包有34.1%概率会在地牢的箱子里并且有34.1%概率会在林地府邸的箱子里以1份为一组的形式出现;有33.5%概率会在要塞祭坛的箱子里,有47.5%概率会在要塞储藏室的箱子里,有59.8%概率会在村庄铁匠的箱子里,并且有44.3%概率会在废弃矿井运输矿车里,皆以1–3份为一组的形式出现;也会在有61.5%概率会在奖励箱的箱子里以1–2份为一组的形式出现。 在1.14中,其有80.6%概率会在村庄盔甲商的箱子里,有80.6%概率会在村庄房屋的箱子里,有61.2%概率会在村庄制图师的箱子里,有71.7%概率会在村庄房屋的箱子里,有66.3%概率会在村庄房屋的箱子里,有62.2%概率会在村庄石匠的箱子里,有76.9%概率会在村庄房屋的箱子里,有65.6%概率会在村庄房屋的箱子里,并且有62.8%概率会在村庄皮革厂的箱子里,皆以1–4份为一组的形式出现;也会在有59.8%概率会在村庄武器匠的箱子里以1–3份为一组的形式出现。

基岩版中,其有32.5%概率会在要塞祭坛的箱子里并且有40.0%概率会在要塞储藏室的箱子里以1–3份为一组的形式出现, 也会在所有的奖励箱的箱子里以1–2份为一组的形式出现。

鞍有2.5%概率会在要塞祭坛的箱子里,有16.2%概率会在村庄铁匠的箱子里,有28.3%概率会在地牢的箱子里,有23.5%概率会在沙漠神殿的箱子里,有15.3%概率会在丛林神庙的箱子里,有35.3%概率会在下界要塞的箱子里,并且有13.3%概率会在末地城的箱子里,皆以1份单独为一组的形式出现。 在1.14中,其有16.2%概率会在村庄武器匠的箱子里,有11.3%概率会在村庄房屋的箱子里,有12.9%概率会在丛林神庙的箱子里,并且有17.3%概率会在村庄皮革厂的箱子里,皆以1份单独为一组的形式出现。

基岩版中,其有2.4%概率会在要塞祭坛的箱子里并且有12.8%概率会在丛林神庙的箱子里以1份单独为一组的形式出现。

音乐唱片(13)有21.8%概率会在地牢的箱子里并且有21.8%概率会在林地府邸的箱子里以1份单独为一组的形式出现。

基岩版中,其有21.5%概率会在林地府邸的箱子里以1份单独为一组的形式出现。

音乐唱片(cat)有21.8%概率会在地牢的箱子里并且有21.8%概率会在林地府邸的箱子里以1份单独为一组的形式出现。

基岩版中,其有21.5%概率会在林地府邸的箱子里以1份单独为一组的形式出现。

马铃薯有50.7%概率会在沉船补给箱的箱子里以2–6份为一组的形式出现。 在1.14中,其有44.9%概率会在沉船补给箱的箱子里以2–6份为一组的形式出现;有66.3%概率会在村庄房屋的箱子里,有76.9%概率会在村庄房屋的箱子里,并且有65.6%概率会在村庄房屋的箱子里,皆以1–7份为一组的形式出现;也会在有57.5%概率会在掠夺者前哨站的箱子里以2–5份为一组的形式出现。

基岩版中,其有50.0%概率会在奖励箱的箱子里以1–2份为一组的形式出现, 也会在有81.7%概率会在村庄两室屋的箱子里以5–8份为一组的形式出现。

骨头有28.7%概率会在沙漠神殿的箱子里并且有69.3%概率会在丛林神庙的箱子里以4–6份为一组的形式出现, 也会在有57.8%概率会在地牢的箱子里,有59.0%概率会在沙漠神殿的箱子里,并且有57.8%概率会在林地府邸的箱子里,皆以1–8份为一组的形式出现。 在1.14中,其有61.9%概率会在丛林神庙的箱子里以4–6份为一组的形式出现。

基岩版中,其有61.8%概率会在丛林神庙的箱子里以4–6份为一组的形式出现。

黑曜石有8.0%概率会在下界要塞的箱子里以2–4份为一组的形式出现, 也会在有25.6%概率会在村庄铁匠的箱子里以3–7份为一组的形式出现。 在1.14中,其有25.6%概率会在村庄武器匠的箱子里以3–7份为一组的形式出现。


Notes[编辑源代码]

  1. 所有魔咒出现的几率相同,有可能出现宝藏附魔,魔咒出现几率与魔咒的等级无关。
  2. 2.00 2.01 2.02 2.03 2.04 2.05 2.06 2.07 2.08 2.09 2.10 2.11 2.12 2.13 魔咒出现的几率与没有30级限制的附魔台上20-39级的附魔相同,可以施加宝藏附魔,多个魔咒出现的几率亦不会降低。
  3. 魔咒出现的几率与附魔台上30级的附魔相同,可以施加宝藏附魔,多个魔咒出现的几率亦不会降低。
  4. 4.0 4.1 4.2 4.3 4.4 4.5 所有魔咒出现的几率相同,不可能出现宝藏附魔,魔咒出现几率与魔咒的等级无关。
  5. “无”不代表出现空箱子的几率。其指的是战利品随机生成器会在这次尝试中不添加任何战利品。
  6. 炖菜将给予以下效果中的一种:5-7秒的失明,7-10秒的跳跃提升,10-20秒的中毒,7-10秒的饱和,7-10秒的速度,或6-8秒的虚弱

local p = {

	calc_average_amount_this_item_per_pool = function( 
			min_stacksize, max_stacksize,
			min_pool_rolls, max_pool_rolls, 
			item_weight, pool_total_item_weight )

		local avg_stacksize = ( min_stacksize + max_stacksize ) / 2
		local avg_rolls = ( min_pool_rolls + max_pool_rolls ) / 2
		
		return avg_stacksize * avg_rolls * item_weight / pool_total_item_weight
		
	end,
	
	calc_chance_any_of_this_item_per_pool = function( 
			min_pool_rolls, max_pool_rolls,
			item_weight, pool_total_item_weight )

		local inverse_result = 0 -- 1 - inverse_result = return value
		local inverse_item_weight = pool_total_item_weight - item_weight
		
		-- will be used for the division in the for loop to avoid the slightly
		-- less performant math.pow(). The divisor already includes the probability
		-- of picking any specific number of rolls.
		local cur_dividend = inverse_item_weight
		local cur_divisor = pool_total_item_weight * (max_pool_rolls - min_pool_rolls + 1)
		
		for i = 1, max_pool_rolls do
			if i >= min_pool_rolls then
				inverse_result = inverse_result + cur_dividend / cur_divisor
			end
			cur_dividend = cur_dividend * inverse_item_weight -- simulate pow
			cur_divisor = cur_divisor * pool_total_item_weight -- simulate pow
		end
		
		return 1 - inverse_result
		
	end,
	
	dev = '在[[1.14]]<!--{{upcoming}}-->中,',
	bedrock = '在[[基岩版]]中,',
	bedrock_beta = '在[[基岩版1.9]]{{upcoming}}中,',
	
	-- these define which sprite, label and link to use, in the table,
	-- and 'cannot_stack' and 'plural' dictate how to display the single-item summary
	
	-- NOTE: order in this list doesn't matter.

	items = {
		["acacia-log"]          = { "block" },
		["acacia-sapling"]      = { "block" },
		["activator-rail"]      = { "block" },
		["apple"]               = { "item" },
		["arrow"]               = { "item" },
		["bamboo"]              = { "item"},
		["beef"]			    = { "item" },
		["beetroot"]            = { "item" },
		["beetroot-seeds"]      = { "item"},
		["beetroot-soup"]		= { "item", cannot_stack=true },
		["birch-log"]           = { "block" },
		["birch-sapling"]       = { "block" },
		["black-wool"]          = { "block"},
		["blue-ice"]            = { "block" },
		["bone"]                = { "item" },
		["book"]                = { "item" },
		["book-and-quill"]      = { "item" },
		["bottle-o'-enchanting"] = { "item" },
		["bread"]               = { "item"},
		["brown-mushroom"]      = { "block" },
		["brown-wool"]          = { "block"},
		["bucket"]              = { "item" },
        ["buried-treasure-map"] = { "item" },
		["cactus"]              = { "block"},
		["cake"]                = { "block"},
		["carrot"]              = { "item" },
		["chainmail-chestplate"] = { "item", cannot_stack=true },
		["chainmail-helmet"]    = { "item", cannot_stack=true },
		["chainmail-leggings"]  = { "item", cannot_stack=true},
		["chainmail-boots"]     = { "item", cannot_stack=true},
		["clay"]				= { "item" },
		["clock"]				= { "item" },
		["cocoa-beans"]         = { "item"},
		["coal"]                = { "item"},
		["cooked-cod"]          = { "item" },
		["cooked-salmon"]       = { "item" },
		["compass"]             = { "item" },
		["crossbow"]            = { "item", cannot_stack=true },
		["dark-oak-log"]        = { "block" },
		["dark-oak-sapling"]    = { "block" },
		["dead-bush"]			= { "block" },
		["detector-rail"]       = { "block" },
		["dandelion"]			= { "block" },
		["diamond"]             = { "item" },
		["diamond-chestplate"]  = { "item", cannot_stack=true },
		["diamond-hoe"]         = { "item", cannot_stack=true },
		["diamond-horse-armor"] = { "item", cannot_stack=true},
		["music-disc-13"]       = { "item", title="音乐唱片(13)", link="音乐唱片", cannot_stack=true },
		["music-disc-cat"]      = { "item", title="音乐唱片(Cat)", link="音乐唱片", cannot_stack=true },
		["music-disc-wait"]     = { "item", title="音乐唱片(Wait)", link="音乐唱片", cannot_stack=true },
		["music-disc-mellohi"]  = { "item", title="音乐唱片(Mellohi)", link="音乐唱片", cannot_stack=true },
		["emerald"]             = { "item" },
		["empty-map"]           = { "item" },
		["enchanted-book"]      = { "item", title="附魔书", link="附魔书", cannot_stack=true, note="enchant-with-levels" },
		["enchanted-book-rnd"]  = { "item", title="附魔书", id='enchanted-book', link="附魔书", cannot_stack=true, note="enchant-randomly" },
		["enchanted-book-rnd-treasure"] = { "item", title="附魔书", id='enchanted-book', link="附魔书", cannot_stack=true, note="enchant-randomly-treasure" },
		["ender-pearl"]         = { "item" },
		["enchanted-fishing-rod"] = { "item", title="附魔的钓鱼竿", id="fishing-rod", link="钓鱼竿", note="enchant-randomly", cannot_stack=true },
		["enchanted-golden-apple"] = { "item", id='golden-apple' },
		["feather"]             = { "item" },
		["fern"]				= { "block" },
		["flint-and-steel"]     = { "item", cannot_stack=true},
		["flower-pot"]			= { "item" },
		["furnace"]             = { "block" },
		["golden-apple"]        = { "item" },
		["golden-chestplate"]   = { "item", cannot_stack=true },
		["golden-helmet"]       = { "item", cannot_stack=true },
		["golden-horse-armor"]  = { "item", cannot_stack=true},
		["golden-sword"]        = { "item", cannot_stack=true },
		["gold-ingot"]          = { "item" },
		["gold-nugget"]         = { "item" },
		["grass"]				= { "block" },
		["gray-wool"]           = { "block"},
		["green-dye"]			= { "item" },
		["gunpowder"]           = { "item"},
		["heart-of-the-sea"]    = { "item" },
		["ink-sac"]             = { "item" },
		["iron-boots"]          = { "item", cannot_stack=true},
		["iron-chestplate"]     = { "item", cannot_stack=true },
		["iron-helmet"]         = { "item", cannot_stack=true },
		["iron-horse-armor"]    = { "item", cannot_stack=true},
		["iron-ingot"]          = { "item" },
		["iron-leggings"]       = { "item", cannot_stack=true},
		["iron-nugget"]         = { "item" },
		["iron-pickaxe"]        = { "item", cannot_stack=true },
		["iron-sword"]          = { "item", cannot_stack=true },
		["jungle-log"]          = { "block" },
		["jungle-sapling"]      = { "block" },
		["lapis-lazuli"]        = { "item"},
		["large-fern"]			= { "block" },
		["lead"]                = { "item" },
		["leather"]      		= { "item" },
		["leather-tunic"]       = { "item", cannot_stack=true },
		["leather-boots"]       = { "item", cannot_stack=true },
		["leather-cap"]         = { "item", cannot_stack=true },
		["leather-pants"]       = { "item", cannot_stack=true },
		["light-gray-wool"]     = { "block"},
		["melon-seeds"]         = { "item"},
		["name-tag"]            = { "item" },
		["nether-wart"]         = { "item"},
		["oak-log"]             = { "block" },
		["oak-planks"]          = { "block", id="oak-wood-planks"},
		["oak-sapling"]         = { "block" },
		["oak-wood-only"]       = { "block", id='oak-log'},
		["obsidian"]            = { "block"},
		["paper"]               = { "item"},
		["poppy"]				= { "block" },
		["potato"]              = { "item" },
		["potion-of-regeneration"] = { "item", preserve_case=true },
		["potion-of-water-breathing"] = { "item", preserve_case=true },
		["poisonous-potato"]    = { "item" },
		["powered-rail"]        = { "block"},
		["prismarine-crystals"] = { "item"},
		["pumpkin"]             = { "block" },
		["pumpkin-seeds"]       = { "item"},
		["pumpkin-pie"]         = { "item" },
		["rail"]                = { "block"},
		["redstone"]            = { "item", id="redstone-dust"},
		["rotten-flesh"]        = { "item"},
		["sand"]                = { "block"},
		["saddle"]              = { "item", cannot_stack=true },
		["raw-mutton"]			= { "item" },
		["raw-salmon"]          = { "item"},
		["raw-porkchop"]		= { "item" },
		["shears"]              = { "item", cannot_stack=true },
		["smooth-stone"]		= { "block"},
		["snowball"]			= { "item" },
		["snow-block"]			= { "block" },
		["spider-eye"]          = { "item" },
		["spruce-log"]          = { "block" },
		["spruce-sapling"]      = { "block" },
		["spruce-sign"]     	= { "item" },
		["stick"]               = { "item" },
		["stone"]               = { "block"},
		["stone-bricks"]        = { "block"},
		["stone-axe"]           = { "item", cannot_stack=true },
		["stone-pickaxe"]       = { "item", cannot_stack=true },
		["string"]              = { "item"},
		["suspicious-stew"]     = { "item", note="suspicious-stew" },
		["sweet-berries"]       = { "item"},
		["tall-grass"]			= { "block" },
		["tnt"]                 = { "block", preserve_case=true },
		["torch"]               = { "block" },
		["wheat"]               = { "item"},
		["wheat-seeds"]         = { "item"},
		["white-wool"]          = { "block"},
		["wooden-axe"]          = { "item", cannot_stack=true },
		["wooden-hoe"]          = { "item", cannot_stack=true },
		["wooden-pickaxe"]      = { "item", cannot_stack=true },
		["yellow-dye"]			= { "item" },

		["enchanted-leather-cap"]        = { "item", title="附魔的皮革帽子", id="leather-cap", link="盔甲", note="enchant-randomly", cannot_stack=true },
		["enchanted-leather-tunic"]      = { "item", title="附魔的皮革外套", id="leather-tunic", link="盔甲", note="enchant-randomly", cannot_stack=true },
		["enchanted-leather-pants"]      = { "item", title="附魔的皮革裤子", id="leather-pants", link="盔甲", note="enchant-randomly", cannot_stack=true },
		["enchanted-leather-boots"]      = { "item", title="附魔的皮革靴子", id="leather-boots", link="盔甲", note="enchant-randomly", cannot_stack=true },
		["enchanted-diamond-boots"]      = { "item", title="附魔的钻石靴子", id="diamond-boots", link="盔甲", note="enchant-with-levels-20-39", cannot_stack=true },
		["enchanted-diamond-chestplate"] = { "item", title="附魔的钻石胸甲", id="diamond-chestplate", link="盔甲", note="enchant-with-levels-20-39", cannot_stack=true },
		["enchanted-diamond-helmet"]     = { "item", title="附魔的钻石头盔", id="diamond-helmet", link="盔甲", note="enchant-with-levels-20-39", cannot_stack=true },
		["enchanted-diamond-leggings"]   = { "item", title="附魔的钻石护腿", id="diamond-leggings", link="盔甲", note="enchant-with-levels-20-39", cannot_stack=true },
		["enchanted-diamond-pickaxe"]    = { "item", title="附魔的钻石锹", id="diamond-pickaxe", link="镐", note="enchant-with-levels-20-39", cannot_stack=true },
		["enchanted-diamond-shovel"]     = { "item", title="附魔的钻石", id="diamond-shovel", link="锹", note="enchant-with-levels-20-39", cannot_stack=true },
		["enchanted-diamond-sword"]      = { "item", title="附魔的钻石剑", id="diamond-sword", link="剑", note="enchant-with-levels-20-39", cannot_stack=true },
		["enchanted-iron-boots"]         = { "item", title="附魔的铁靴子", id="iron-boots", link="盔甲", note="enchant-with-levels-20-39", cannot_stack=true },
		["enchanted-iron-chestplate"]    = { "item", title="附魔的铁胸甲", id="iron-chestplate", link="盔甲", note="enchant-with-levels-20-39", cannot_stack=true },
		["enchanted-iron-helmet"]        = { "item", title="附魔的铁头盔", id="iron-helmet", link="盔甲", note="enchant-with-levels-20-39", cannot_stack=true },
		["enchanted-iron-leggings"]      = { "item", title="附魔的铁护腿", id="iron-leggings", link="盔甲", note="enchant-with-levels-20-39", cannot_stack=true },
		["enchanted-iron-pickaxe"]       = { "item", title="附魔的铁镐", id="iron-pickaxe", link="镐", note="enchant-with-levels-20-39", cannot_stack=true },
		["enchanted-iron-shovel"]        = { "item", title="附魔的铁锹", id="iron-shovel", link="锹", note="enchant-with-levels-20-39", cannot_stack=true },
		["enchanted-iron-sword"]         = { "item", title="附魔的铁剑", id="iron-sword", link="剑", note="enchant-with-levels-20-39", cannot_stack=true },

		["empty"]                        = { "block", id="air", link='', title='无', note="nothing" },
	},

	notes3 = {
		["enchant-with-levels"] = "Enchantment probabilities are the same as a level-30 enchantment on an [[enchantment table]] that was able to apply [[treasure enchantment]]s, and where the chance of multiple enchantments is not reduced.",
		["enchant-with-levels-20-39"] = "Enchantment probabilities are the same as a level-20 to level-39 [[enchantment mechanics|enchantment]] would be on an [[enchantment table]] that had no cap at level 30, and that was able to apply [[treasure enchantment]]s, and where the chance of multiple enchantments is not reduced.",
		["enchant-randomly"] = "All enchantments are equally probable, ''except'' [[treasure enchantment]]s, and any level of the enchantment is equally probable.",
		["enchant-randomly-treasure"] = "All enchantments are equally probable, ''including'' [[treasure enchantment]]s, and any level of the enchantment is equally probable.",
		["nothing"] = "'Nothing' does not refer to the chance of an empty chest.  Instead, it refers to the chance that the random loot generator will not add any loot ''on a single roll''.",
		["suspicious-stew"] = "The stew will grant one of the following effects: 5–7 seconds of [[Blindness]], 7–10 seconds of [[Jump Boost]], 10–20 seconds of [[Poison]], 7–10 seconds of [[Saturation]], 7–10 seconds of [[Speed]], or 6–8 seconds of [[Weakness]].",
	},

	notes = {
		["enchant-with-levels"] = "<ref group='注' name='enchant-with-levels'>魔咒出现的几率与[[附魔台]]上30级的附魔相同,可以施加[[附魔机制#宝藏|宝藏附魔]],多个魔咒出现的几率亦不会降低。</ref>",
		["enchant-with-levels-20-39"] = "<ref group='注' name='enchant-with-levels-20-39'>魔咒出现的几率与没有30级限制的[[附魔台]]上20-39级的附魔相同,可以施加[[附魔机制#宝藏|宝藏附魔]],多个魔咒出现的几率亦不会降低。</ref>",
		["enchant-randomly"] = "<ref group='注' name='enchant-randomly'>所有魔咒出现的几率相同,不可能出现[[附魔机制#宝藏|宝藏附魔]],魔咒出现几率与魔咒的等级无关。</ref>",
		["enchant-randomly-treasure"] = "<ref group='注' name='enchant-randomly-treasure'>所有魔咒出现的几率相同,有可能出现[[附魔机制#宝藏|宝藏附魔]],魔咒出现几率与魔咒的等级无关。</ref>",
		["nothing"] = "<ref group='注' name='nothing'>“无”不代表出现空箱子的几率。其指的是战利品随机生成器会在这次尝试中不添加任何战利品。</ref>",
		["suspicious-stew"] = "<ref group='注' name='suspicious-stew'>炖菜将给予以下效果中的一种:5-7秒的[[失明]],7-10秒的[[跳跃提升]],10-20秒的[[中毒]],7-10秒的[[饱和]],7-10秒的[[速度]],或6-8秒的[[虚弱]]</ref>",
	},
	
	-- NOTE: order here doesn't matter.  
	--		 * in the table, chests will sort in alphabetical order
	--       * in the table, items will sort by chance, then by avg#, then alphabetically.
	--       * If poolsDev is omitted, pools will be used. To omit a pool entirely in the dev version, set poolsDev = {}.
	
	chests = {
		["shipwreck-map"] = { -- shipwreck_map.json
			header = "地图箱",
			superheader = "[[沉船]]",
			link   = "[[水下遗迹]]地图箱",
			structure = "水下遗迹",
			container = "地图箱",
			structID = "shipwreck",
			pools = {
				{
					rolls = {1,1},
					items = {
                        ["buried-treasure-map"] = {1,1,1},
					}
				},
				{
					rolls = {3,3},
					items = {
						["compass"]             = {1,1,1},
						["empty-map"]           = {1,1,1},
						["clock"]               = {1,1,1},
						["paper"]               = {1,10,20},
						["feather"]             = {1,5,10},
						["book"]                = {1,5,5},
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["shipwreck-supply"] = { -- shipwreck_supply.json
			header = "补给箱",
			superheader = "[[沉船]]",
			link   = "[[沉船]]补给箱",
			structure = "沉船",
			container = "补给箱",
			structID = "shipwreck",
			pools = {
				{
					rolls = {3,10},
					items = {
						["paper"]               = {1,12,8},
						["potato"]              = {2,6,7},
						["poisonous-potato"]    = {2,6,7},
						["carrot"]              = {4,8,7},
						["wheat"]               = {8,21,7},
						["coal"]                = {2,8,6},
						["rotten-flesh"]        = {5,24,5},
						["pumpkin"]             = {1,3,2},
						["gunpowder"]           = {1,5,3},
						["tnt"]                 = {1,2,1},
						["enchanted-leather-cap"]         = {1,1,3},
						["enchanted-leather-tunic"]       = {1,1,3},
						["enchanted-leather-pants"]       = {1,1,3},
						["enchanted-leather-boots"]       = {1,1,3},
					}
				},
			},
			poolsDev = {
				{
					rolls = {3,10},
					items = {
						["paper"]               = {1,12,8},
						["potato"]              = {2,6,7},
						["poisonous-potato"]    = {2,6,7},
						["carrot"]              = {4,8,7},
						["wheat"]               = {8,21,7},
						["coal"]                = {2,8,6},
						["rotten-flesh"]        = {5,24,5},
						["bamboo"]              = {1,3,2},
						["suspicious-stew"]     = {1,1,10},
						["pumpkin"]             = {1,3,2},
						["gunpowder"]           = {1,5,3},
						["tnt"]                 = {1,2,1},
						["enchanted-leather-cap"]         = {1,1,3},
						["enchanted-leather-tunic"]       = {1,1,3},
						["enchanted-leather-pants"]       = {1,1,3},
						["enchanted-leather-boots"]       = {1,1,3},
					}
				},
			},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["shipwreck-treasure"] = { -- shipwreck_treasure.json
			header = "宝箱",
			superheader = "[[沉船]]",
			link   = "[[沉船]]宝箱",
			structure = "沉船",
			container = "宝箱",
			structID = "shipwreck",
			pools = {
				{
					rolls = {3,6},
					items = {
						["iron-ingot"]          = {1,5,90},
						["gold-ingot"]          = {1,5,10},
						["emerald"]             = {1,5,40},
						["diamond"]             = {1,1,5},
						["bottle-o'-enchanting"] = {1,1,5},
					}
				},
				{
					rolls = {2,5},
					items = {
						["iron-nugget"]         = {1,10,50},
						["gold-nugget"]         = {1,10,10},
						["lapis-lazuli"]        = {1,10,20},
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["buried-treasure"] = { -- buried_treasure.json
			header = "[[埋藏的宝藏]]",
			link   = "[[埋藏的宝藏]]",
			structure = "埋藏的宝藏",
			container = "",
			structID = "buried-treasure",
			pools = {
				{
					rolls = {1,1},
					items = {
						["heart-of-the-sea"]    = {1,1,1},
					}
				},
				{
					rolls = {5,8},
					items = {
						["iron-ingot"]          = {1,4,20},
						["gold-ingot"]          = {1,4,10},
						["tnt"]                 = {1,2,5},
					}
				},
				{
					rolls = {1,3},
					items = {
						["emerald"]             = {4,8,5},
						["diamond"]             = {1,2,5},
						["prismarine-crystals"] = {1,5,5},
					}
				},
				{
					rolls = {0,1},
					items = {
						["leather-tunic"]       = {1,1,1},
						["iron-sword"]          = {1,1,1},
					}
				},
				{
					rolls = {2,2},
					items = {
						["cooked-cod"]          = {2,4,1},
						["cooked-salmon"]       = {2,4,1},
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {
				{
					rolls = {1,1},
					items = {
						["heart-of-the-sea"]    = {1,1,1},
					}
				},
				{
					rolls = {5,12},
					items = {
						["prismarine-crystals"] = {1,5,5},
						["iron-ingot"]          = {3,5,20},
						["gold-ingot"]          = {1,5,10},
						["tnt"]                 = {1,2,10},
						["diamond"]             = {1,1,15},
						["music-disc-wait"]           = {1,1,5},
						["music-disc-mellohi"]        = {1,1,5},
						["name-tag"]            = {1,1,10},
						["chainmail-chestplate"] = {1,1,20},
						["chainmail-helmet"]    = {1,1,20},
						["chainmail-leggings"]  = {1,1,20},
						["chainmail-boots"]     = {1,1,20},
						["book-and-quill"]      = {1,2,5},
						["lead"]                = {1,3,10},
						["bottle-o'-enchanting"] = {1,1,3},
						["potion-of-water-breathing"] = {1,1,15},
						["potion-of-regeneration"] = {1,1,10},
						["cake"]                = {1,1,1},
					}
				},
			},
			poolsBedrockBeta = {}
		},
		["underwater-ruin-big"] = { -- underwater_ruin_big.json
			header = "大型",
			superheader = "[[水下遗迹]]",
			link   = "大型[[水下遗迹]]",
			structure = "水下遗迹",
			container = "大型遗迹箱子",
			structID = "underwater-ruins",
			pools = {
				{
					rolls = {2,8},
					items = {
						["coal"]                = {1,4,10},
						["gold-nugget"]         = {1,3,10},
						["emerald"]             = {1,1,1},
						["wheat"]               = {2,3,10},
					}
				},
				{
					rolls = {1,1},
					items = {
						["golden-apple"]        = {1,1,1},
						["enchanted-book-rnd"]  = {1,1,5},
						["leather-tunic"]       = {1,1,1},
						["golden-helmet"]       = {1,1,1},
						["enchanted-fishing-rod"] = {1,1,5},
                        ["buried-treasure-map"] = {1,1,10},
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["underwater-ruin-small"] = { -- underwater_ruin_small.json
			header = "小型",
			superheader = "[[水下遗迹]]",
			link   = "小型[[水下遗迹]]",
			structure = "水下遗迹",
			container = "小型遗迹箱子",
			structID = "underwater-ruins",
			pools = {
				{
					rolls = {2,8},
					items = {
						["coal"]                = {1,4,10},
						["stone-axe"]           = {1,1,2},
						["rotten-flesh"]        = {1,1,5},
						["emerald"]             = {1,1,1},
						["wheat"]               = {2,3,10},
					}
				},
				{
					rolls = {1,1},
					items = {
						["leather-tunic"]       = {1,1,1},
						["golden-helmet"]       = {1,1,1},
						["enchanted-fishing-rod"] = {1,1,5},
                        ["buried-treasure-map"] = {1,1,5},
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["village-blacksmith"] = { -- Moved to Weaponsmith in Java 1.14
			header = "铁匠",
			superheader = "[[村庄]]",
			link   = "[[村庄]]铁匠",
			structure = "村庄",
			container = "铁匠的箱子",
			structID = "village",
			pools = {
				{
					rolls = {3,8},
					items = {
						["diamond"]             = {1,3,3},
						["iron-ingot"]          = {1,5,10},
						["gold-ingot"]          = {1,3,5},
						["bread"]               = {1,3,15},
						["apple"]               = {1,3,15},
						["iron-pickaxe"]        = {1,1,5},
						["iron-sword"]          = {1,1,5},
						["iron-chestplate"]     = {1,1,5},
						["iron-helmet"]         = {1,1,5},
						["iron-leggings"]       = {1,1,5},
						["iron-boots"]          = {1,1,5},
						["obsidian"]            = {3,7,5},
						["oak-sapling"]         = {3,7,5},
						["iron-horse-armor"]    = {1,1,1},
						["golden-horse-armor"]  = {1,1,1},
						["diamond-horse-armor"] = {1,1,1},
						["saddle"]              = {1,1,3}
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		
		["village-armorer"] = { -- village\village_armorer.json
			header = "盔甲商",
			superheader = "[[村庄]]",
			link   = "[[村庄]]盔甲商",
			structure = "村庄",
			container = "盔甲商的箱子",
			structID = "village",
			pools = {},
			poolsDev =  {
				{
					rolls = {1,5},
					items = {
						["iron-ingot"]     = {1,3,2},
						["bread"]          = {1,4,4},
						["iron-helmet"]    = {1,1,1},
						["emerald"]        = {1,1,1}
					}
				},
			},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["village-butcher"] = { -- village\village_butcher.json
			header = "屠夫",
			superheader = "[[村庄]]",
			link   = "[[村庄]]屠夫",
			structure = "村庄",
			container = "屠夫的箱子",
			structID = "village",
			pools = {},
			poolsDev =  {
				{
					rolls = {1,5},
					items = {
						["emerald"]        = {1,1,1},
						["raw-porkchop"]   = {1,3,6},
						["wheat"]          = {1,3,6},
						["beef"]           = {1,3,6},
						["raw-mutton"]     = {1,3,6},
						["coal"]           = {1,3,3}
					}
				},
			},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["village-cartographer"] = { -- village\village_cartographer.json
			header = "制图师",
			superheader = "[[村庄]]",
			link   = "[[村庄]]制图师",
			structure = "村庄",
			container = "制图师的箱子",
			structID = "village",
			pools = {},
			poolsDev =  {
				{
					rolls = {1,5},
					items = {
						["empty-map"]      = {1,3,10},
						["paper"]          = {1,5,15},
						["compass"]        = {1,1,5},
						["bread"]          = {1,4,15},
						["oak-sapling"]    = {1,2,5}
					}
				},
			},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["village-mason"] = { -- village\village_mason.json
			header = "石匠",
			superheader = "[[村庄]]",
			link   = "[[村庄]]石匠",
			structure = "村庄",
			container = "石匠的箱子",
			structID = "village",
			pools = {},
			poolsDev =  {
				{
					rolls = {1,5},
					items = {
						["clay"]           = {1,3,1},
						["flower-pot"]     = {1,1,1},
						["stone"]          = {1,1,2},
						["stone-bricks"]   = {1,1,2},
						["bread"]          = {1,4,4},
						["yellow-dye"]     = {1,1,1},
						["smooth-stone"]   = {1,1,1},
						["emerald"]        = {1,1,1}
					}
				},
			},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["village-shepherd"] = { -- village\village_shepherd.json
			header = "牧羊人",
			superheader = "[[村庄]]",
			link   = "[[村庄]]牧羊人",
			structure = "村庄",
			container = "牧羊人的箱子",
			structID = "village",
			pools = {},
			poolsDev =  {
				{
					rolls = {1,5},
					items = {
						["white-wool"]      = {1,8,6},
						["black-wool"]      = {1,3,3},
						["gray-wool"]       = {1,3,2},
						["brown-wool"]      = {1,3,2},
						["light-gray-wool"] = {1,3,2},
						["emerald"]         = {1,1,1},
						["shears"]          = {1,1,1},
						["wheat"]           = {1,6,6}
					}
				},
			},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["village-tannery"] = { -- village\village_tannery.json
			header = "皮革厂",
			superheader = "[[村庄]]",
			link   = "[[村庄]]皮革厂",
			structure = "村庄",
			container = "皮革厂箱子",
			structID = "village",
			pools = {},
			poolsDev =  {
				{
					rolls = {1,5},
					items = {
						["leather"]         = {1,3,1},
						["leather-tunic"]   = {1,1,2},
						["leather-boots"]   = {1,1,2},
						["leather-cap"]     = {1,1,2},
						["bread"]           = {1,4,5},
						["leather-pants"]   = {1,1,2},
						["saddle"]          = {1,1,1},
						["emerald"]         = {1,4,1}
					}
				},
			},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["village-weaponsmith"] = { -- village\village_weaponsmith.json
			header = "武器匠",
			superheader = "[[村庄]]",
			link   = "[[村庄]]武器匠",
			structure = "村庄",
			container = "武器匠的箱子",
			structID = "village",
			pools = {},
			poolsDev =  {
				{
					rolls = {3,8},
					items = {
						["diamond"]             = {1,3,3},
						["iron-ingot"]          = {1,5,10},
						["gold-ingot"]          = {1,3,5},
						["bread"]               = {1,3,15},
						["apple"]               = {1,3,15},
						["iron-pickaxe"]        = {1,1,5},
						["iron-sword"]          = {1,1,5},
						["iron-chestplate"]     = {1,1,5},
						["iron-helmet"]         = {1,1,5},
						["iron-leggings"]       = {1,1,5},
						["iron-boots"]          = {1,1,5},
						["obsidian"]            = {3,7,5},
						["oak-sapling"]         = {3,7,5},
						["saddle"]              = {1,1,3},
						["iron-horse-armor"]    = {1,1,1},
						["golden-horse-armor"]  = {1,1,1},
						["diamond-horse-armor"] = {1,1,1}
					}
				},
			},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		
		["village-desert-house"] = { -- village\village_desert_house.json
			header = "沙漠房屋",
			superheader = "[[村庄]]",
			link   = "[[村庄]]房屋",
			structure = "村庄",
			container = "沙漠村庄的箱子",
			structID = "village",
			pools = {},
			poolsDev =  {
				{
					rolls = {3,8},
					items = {
						["clay"]            = {1,1,1},
						["green-dye"]       = {1,1,1},
						["cactus"]          = {1,4,10},
						["wheat"]           = {1,7,10},
						["bread"]           = {1,4,10},
						["book"]            = {1,1,1},
						["dead-bush"]       = {1,3,2},
						["emerald"]         = {1,3,1}
					}
				},
			},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["village-plains-house"] = { -- village\village_plains_house.json
			header = "平原房屋",
			superheader = "[[村庄]]",
			link   = "[[村庄]]房屋",
			structure = "村庄",
			container = "平原村庄的箱子",
			structID = "village",
			pools = {},
			poolsDev =  {
				{
					rolls = {3,8},
					items = {
						["gold-nugget"]     = {1,3,1},
						["dandelion"]       = {1,1,1},
						["poppy"]           = {1,1,1},
						["potato"]          = {1,7,10},
						["bread"]           = {1,4,10},
						["apple"]           = {1,5,10},
						["emerald"]         = {1,4,2},
						["oak-sapling"]     = {1,2,5}
					}
				},
			},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["village-savanna-house"] = { -- village\village_savanna_house.json
			header = "热带高原房屋",
			superheader = "[[村庄]]",
			link   = "[[村庄]]房屋",
			structure = "村庄",
			container = "热带高原村庄的箱子",
			structID = "village",
			pools = {},
			poolsDev =  {
				{
					rolls = {3,8},
					items = {
						["gold-nugget"]     = {1,3,1},
						["grass"]           = {1,1,5},
						["tall-grass"]      = {1,1,5},
						["bread"]           = {1,4,10},
						["wheat-seeds"]     = {1,5,10},
						["emerald"]         = {1,4,2},
						["acacia-sapling"]  = {1,2,10},
						["saddle"]          = {1,1,1},
						["torch"]           = {1,2,1},
						["bucket"]          = {1,1,1}
					}
				},
			},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["village-snowy-house"] = { -- village\village_snowy_house.json
			header = "雪域房屋",
			superheader = "[[村庄]]",
			link   = "[[村庄]]房屋",
			structure = "村庄",
			container = "雪域村庄的箱子",
			structID = "village",
			pools = {},
			poolsDev =  {
				{
					rolls = {3,8},
					items = {
						["blue-ice"]        = {1,1,1},
						["snow-block"]      = {1,1,4},
						["potato"]          = {1,7,10},
						["bread"]           = {1,4,10},
						["beetroot-seeds"]  = {1,5,10},
						["beetroot-soup"]   = {1,1,1},
						["furnace"]         = {1,1,1},
						["emerald"]         = {1,4,1},
						["snowball"]        = {1,7,10},
						["coal"]            = {1,4,5}
					}
				},
			},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["village-taiga-house"] = { -- village\village_taiga_house.json
			header = "针叶林房屋",
			superheader = "[[村庄]]",
			link   = "[[村庄]]房屋",
			structure = "村庄",
			container = "针叶林村庄的箱子",
			structID = "village",
			pools = {},
			poolsDev =  {
				{
					rolls = {3,8},
					items = {
						["iron-nugget"]     = {1,5,1},
						["fern"]            = {1,1,2},
						["large-fern"]      = {1,1,2},
						["potato"]          = {1,7,10},
						["sweet-berries"]   = {1,7,5},
						["bread"]           = {1,4,10},
						["pumpkin-seeds"]   = {1,5,5},
						["pumokin-pie"]     = {1,1,1},
						["emerald"]         = {1,4,2},
						["spruce-sapling"]  = {1,5,5},
						["spruce-sign"]     = {1,1,1},
						["spruce-log"]      = {1,5,10}
					}
				},
			},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		
		["village-two-room-house"] = { -- village_two_room_house.json
			header = "两室屋",
			superheader = "[[村庄]]",
			link   = "[[村庄]]两室屋",
			structure = "村庄",
			container = "屋内箱子",
			structID = "village",
			pools = {},
			poolsDev = {},
			poolsBedrock = {
				{
					rolls = {6,8},
					items = {
						["potato"]      = {5,8,10},
						["carrot"]      = {4,8,10},
						["wheat"]       = {8,12,15},
						["wheat-seeds"] = {2,4,5},
						["beetroot"]    = {5,8,5},
						["wooden-hoe"]  = {1,1,1}
					}
				},
			},
			poolsBedrockBeta = {}
		},
		["stronghold-altar"] = { -- stronghold_corridor.json
			header      = "祭坛",
			superheader = "[[要塞]]",
			link        = "[[要塞]]祭坛",
			structure = "要塞",
			container = "祭坛箱子",
			structID = "stronghold",
			pools = {
				{
					rolls = {2,3},
					items = {
						["ender-pearl"]         = {1,1,10},
						["diamond"]             = {1,3,3},
						["iron-ingot"]          = {1,5,10},
						["gold-ingot"]          = {1,3,5},
						["redstone"]            = {4,9,5},
						["bread"]               = {1,3,15},
						["apple"]               = {1,3,15},
						["iron-pickaxe"]        = {1,1,5},
						["iron-sword"]          = {1,1,5},
						["iron-chestplate"]     = {1,1,5},
						["iron-helmet"]         = {1,1,5},
						["iron-leggings"]       = {1,1,5},
						["iron-boots"]          = {1,1,5},
						["golden-apple"]        = {1,1,1},
						["saddle"]              = {1,1,1},
						["iron-horse-armor"]    = {1,1,1},
						["golden-horse-armor"]  = {1,1,1},
						["diamond-horse-armor"] = {1,1,1},
						["enchanted-book"]      = {1,1,1},
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {
				{
					rolls = {2,3},
					items = {
						["ender-pearl"]         = {1,1,50},
						["emerald"]             = {1,3,15},
						["diamond"]             = {1,3,15},
						["iron-ingot"]          = {1,5,50},
						["gold-ingot"]          = {1,3,25},
						["redstone"]            = {4,9,25},
						["bread"]               = {1,3,75},
						["apple"]               = {1,3,75},
						["iron-pickaxe"]        = {1,1,25},
						["iron-sword"]          = {1,1,25},
						["iron-chestplate"]     = {1,1,25},
						["iron-helmet"]         = {1,1,25},
						["iron-leggings"]       = {1,1,25},
						["iron-boots"]          = {1,1,25},
						["golden-apple"]        = {1,1,5},
						["saddle"]              = {1,1,5},
						["iron-horse-armor"]    = {1,1,5},
						["golden-horse-armor"]  = {1,1,5},
						["diamond-horse-armor"] = {1,1,5},
						["enchanted-book"]      = {1,1,6},
					}
				},
			},
			poolsBedrockBeta = {}
		},
		["stronghold-library"] = { -- stronghold_library.json
			header      = "图书馆",
			superheader = "[[要塞]]",
			link        = "[[要塞]]图书馆",
			structure = "要塞",
			container = "图书馆箱子",
			structID = "stronghold",
			pools = {
				{
					rolls = {2,10},
					items = {
						["book"]                = {1,3,20},
						["paper"]               = {2,7,20},
						["empty-map"]           = {1,1,1},
						["compass"]             = {1,1,1},
						["enchanted-book"]      = {1,1,10},
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {
				{
					rolls = {2,10},
					items = {
						["book"]                = {1,3,100},
						["paper"]               = {2,7,100},
						["empty-map"]           = {1,1,5},
						["compass"]             = {1,1,5},
						["enchanted-book"]      = {1,1,60},
					}
				},
			},
			poolsBedrockBeta = {}
		},
		["stronghold-storeroom"] = { -- stronghold_crossing.json
			header      = "储藏室",
			superheader = "[[要塞]]",
			link        = "[[要塞]]储藏室",
			structure = "要塞",
			container = "储藏室箱子",
			structID = "stronghold",
			pools = {
				{
					rolls = {1,4},
					items = {
						["iron-ingot"]          = {1,5,10},
						["gold-ingot"]          = {1,3,5},
						["redstone"]            = {4,9,5},
						["coal"]                = {3,8,10},
						["bread"]               = {1,3,15},
						["apple"]               = {1,3,15},
						["iron-pickaxe"]        = {1,1,1},
						["enchanted-book"]      = {1,1,1},
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {
				{
					rolls = {1,4},
					items = {
						["iron-ingot"]          = {1,5,50},
						["gold-ingot"]          = {1,3,25},
						["redstone"]            = {4,9,25},
						["coal"]                = {3,8,50},
						["bread"]               = {1,3,75},
						["apple"]               = {1,3,75},
						["iron-pickaxe"]        = {1,1,5},
						["enchanted-book"]      = {1,1,6},
						["ink-sac"]             = {1,3,75},
					}
				},
			},
			poolsBedrockBeta = {}
		},
		["bonus"] = { -- spawn_bonus_chest.json
			header = "[[箱子#奖励箱|奖励箱]]",
			link   = "[[箱子#奖励箱|奖励箱]]",
			structure = "奖励箱",
			container = "",
			structID = "day",
			pools = {
				{
					rolls = {1,1},
					items = {
						["stone-axe"]           = {1,1,1},
						["wooden-axe"]          = {1,1,3},
					}
				},
				{
					rolls = {1,1},
					items = {
						["stone-pickaxe"]       = {1,1,1},
						["wooden-pickaxe"]      = {1,1,3}
					}
				},
				{
					rolls = {3,3},
					items = {
						["apple"]               = {1,2,5},
						["bread"]               = {1,2,3},
						["raw-salmon"]          = {1,2,3},
					}
				},
				{
					rolls = {4,4},
					items = {
						["stick"]               = {1,12,10},
						["oak-planks"]          = {1,12,10},
						["oak-log"]             = {1,3,3},
						["spruce-log"]          = {1,3,3},
						["birch-log"]           = {1,3,3},
						["jungle-log"]          = {1,3,3},
						["acacia-log"]          = {1,3,3},
						["dark-oak-log"]        = {1,3,3},
					}
				},
			},
		    poolsDev = {},
			poolsBedrock = {
				{
					rolls = {1,1},
					items = {
						["stone-axe"]           = {1,1,1},
						["wooden-axe"]          = {1,1,3},
					}
				},
				{
					rolls = {1,1},
					items = {
						["stone-pickaxe"]       = {1,1,1},
						["wooden-pickaxe"]      = {1,1,3}
					}
				},
				{
					rolls = {1,1},
					items = {
						["apple"]               = {1,2,1}
					}
				},
				{
					rolls = {1,1},
					items = {
						["bread"]               = {1,2,1}
					}
				},
				{
					rolls = {1,1},
					items = {
						["raw-salmon"]          = {1,2,1}
					}
				},
				{
					rolls = {1,1},
					items = {
						["stick"]               = {1,12,1}
					}  
				},
				{
					rolls = {1,1},
					items = {
						["oak-planks"]          = {1,12,1}
					}  
				},
				{
					rolls = {1,1},
					items = {
						["dark-oak-log"]        = {1,3,1},
						["acacia-log"]          = {1,3,1},
					}
				},
				{
					rolls = {1,1},
					items = {
						["oak-log"]             = {1,3,1},
						["spruce-log"]          = {1,3,1},
						["birch-log"]           = {1,3,1},
						["jungle-log"]          = {1,3,1},
					}
				},
				{
					rolls = {1,1},
					items = {
						["potato"]              = {1,2,3},
						["carrot"]              = {1,2,3},
					}
				},
				{
					rolls = {1,1},
					items = {
						["oak-sapling"]         = {4,4,2},
						["spruce-sapling"]      = {4,4,2},
						["birch-sapling"]       = {4,4,2},
						["jungle-sapling"]      = {4,4,2},
						["dark-oak-sapling"]    = {4,4,2},
						["acacia-sapling"]      = {4,4,2},
					}
				},
				{
					rolls = {1,1},
					items = {
						["melon-seeds"]         = {1,2,3},
						["pumpkin-seeds"]       = {1,2,3},
						["beetroot-seeds"]      = {1,2,3},
					}
				},
				{
					rolls = {1,1},
					items = {
						["cactus"]              = {1,2,3},
						["cocoa-beans"]         = {1,2,3},
					}
				},
				{
					rolls = {1,1},
					items = {
						["brown-mushroom"]              = {1,2,2},
					}
				},
			},
			poolsBedrockBeta = {}
		},
		["dungeon"] = { -- simple_dungeon.json
			header = "[[地牢]]",
			link   = "[[地牢]]",
			structure = "地牢",
			container = "",
			structID = "Dungeon",
			pools = {
				{
					rolls = {1,3},
					items = {
						["saddle"]              = {1,1,20},
						["golden-apple"]        = {1,1,15},
						["enchanted-golden-apple"] = {1,1,2},
						["music-disc-13"]             = {1,1,15},
						["music-disc-cat"]            = {1,1,15},
						["name-tag"]            = {1,1,20},
						["golden-horse-armor"]  = {1,1,10},
						["iron-horse-armor"]    = {1,1,15},
						["diamond-horse-armor"] = {1,1,5},
						["enchanted-book-rnd"]  = {1,1,10},
					}
				},
				{
					rolls = {1,4},
					items = {
						["iron-ingot"]          = {1,4,10},
						["gold-ingot"]          = {1,4,5},
						["bread"]               = {1,1,20},
						["wheat"]               = {1,4,20},
						["bucket"]              = {1,1,10},
						["redstone"]            = {1,4,15},
						["coal"]                = {1,4,15},
						["melon-seeds"]         = {2,4,10},
						["pumpkin-seeds"]       = {2,4,10},
						["beetroot-seeds"]      = {2,4,10},
					}
				},
				{
					rolls = {3,3},
					items = {
						["bone"]                = {1,8,10},
						["gunpowder"]           = {1,8,10},
						["rotten-flesh"]        = {1,8,10},
						["string"]              = {1,8,10},
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["mineshaft"] = { -- abandoned_mineshaft.json
			chest_type = "minecart with chest",
			header = "[[废弃矿井]]",
			link   = "[[废弃矿井]]",
			structure = "废弃矿井",
			container = "",
			structID = "abandoned-mineshaft",
			pools = {
				{
					rolls = {1,1},
					items = {
						["golden-apple"]        = {1,1,20},
						["enchanted-golden-apple"] = {1,1,1},
						["name-tag"]            = {1,1,30},
						["enchanted-book-rnd"]  = {1,1,10},
						["iron-pickaxe"]        = {1,1,5},
						["empty"]				= {1,1,5},
					}
				},
				{
					rolls = {2,4},
					items = {
						["iron-ingot"]          = {1,5,10},
						["gold-ingot"]          = {1,3,5},
						["redstone"]            = {4,9,5},
						["lapis-lazuli"]        = {4,9,5},
						["diamond"]             = {1,2,3},
						["coal"]                = {3,8,10},
						["bread"]               = {1,3,15},
						["melon-seeds"]         = {2,4,10},
						["pumpkin-seeds"]       = {2,4,10},
						["beetroot-seeds"]      = {2,4,10},
					}
				},
				{
					rolls = {3,3},
					items = {
						["rail"]                = {4,8,20},
						["powered-rail"]        = {1,4,5},
						["detector-rail"]       = {1,4,5},
						["activator-rail"]      = {1,4,5},
						["torch"]               = {1,16,15},
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["nether-fortress"] = { -- nether_bridge.json
			header = "[[下界要塞]]",
			link   = "[[下界要塞]]",
			structure = "下界要塞",
			container = "",
			structID = "nether-fortress",
			pools = {
				{
					rolls = {2,4},
					items = {
						["diamond"]             = {1,3,5},
						["iron-ingot"]          = {1,5,5},
						["gold-ingot"]          = {1,3,15},
						["golden-sword"]        = {1,1,5},
						["golden-chestplate"]   = {1,1,5},
						["flint-and-steel"]     = {1,1,5},
						["nether-wart"]         = {3,7,5},
						["saddle"]              = {1,1,10},
						["golden-horse-armor"]    = {1,1,8},
						["iron-horse-armor"]    = {1,1,5},
						["diamond-horse-armor"] = {1,1,3},
						["obsidian"]            = {2,4,2},
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["desert-temple"] = { -- desert_pyramid.json
			header = "[[沙漠神殿]]",
			link   = "[[沙漠神殿]]",
			structure = "沙漠神殿",
			container = "",
			structID = "desert-temple",
			pools = {
				{
					rolls = {2,4},
					items = {
						["diamond"]             = {1,3,5},
						["iron-ingot"]          = {1,5,15},
						["gold-ingot"]          = {2,7,15},
						["emerald"]             = {1,3,15},
						["bone"]                = {4,6,25},
						["spider-eye"]          = {1,3,25},
						["rotten-flesh"]        = {3,7,25},
						["saddle"]              = {1,1,20},
						["iron-horse-armor"]    = {1,1,15},
						["golden-horse-armor"]  = {1,1,10},
						["diamond-horse-armor"] = {1,1,5},
						["enchanted-book-rnd"]  = {1,1,20},
						["golden-apple"]        = {1,1,20},
						["enchanted-golden-apple"] = {1,1,2},
						["empty"]               = {1,1,15},
					}
				},
				{
					rolls = {4,4},
					items = {
						["bone"]                = {1,8,10},
						["gunpowder"]           = {1,8,10},
						["rotten-flesh"]        = {1,8,10},
						["string"]              = {1,8,10},
						["sand"]                = {1,8,10},
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["jungle-temple"] = { -- jungle_temple.json
			header = "[[丛林神庙]]",
			link   = "[[丛林神庙]]",
			structure = "丛林神庙",
			container = "箱子",
			structID = "jungle-temple",
			pools = {
				{
					rolls = {2,6},
					items = {
						["diamond"]             = {1,3,3},
						["iron-ingot"]          = {1,5,10},
						["gold-ingot"]          = {2,7,15},
						["emerald"]             = {1,3,2},
						["bone"]                = {4,6,20},
						["rotten-flesh"]        = {3,7,16},
						["saddle"]              = {1,1,3},
						["iron-horse-armor"]    = {1,1,1},
						["golden-horse-armor"]  = {1,1,1},
						["diamond-horse-armor"] = {1,1,1},
						["enchanted-book"]      = {1,1,1}
					}
				},
			},
			poolsDev = {
				{
					rolls = {2,6},
					items = {
						["diamond"]             = {1,3,3},
						["iron-ingot"]          = {1,5,10},
						["gold-ingot"]          = {2,7,15},
						["emerald"]             = {1,3,2},
						["bone"]                = {4,6,20},
						["bamboo"]              = {1,3,15},
						["rotten-flesh"]        = {3,7,16},
						["saddle"]              = {1,1,3},
						["iron-horse-armor"]    = {1,1,1},
						["golden-horse-armor"]  = {1,1,1},
						["diamond-horse-armor"] = {1,1,1},
						["enchanted-book"]      = {1,1,1}
					}
				},
			},
			poolsBedrock = {
				{
					rolls = {2,6},
					items = {
						["diamond"]             = {1,3,15},
						["iron-ingot"]          = {1,5,50},
						["gold-ingot"]          = {2,7,75},
						["emerald"]             = {1,3,10},
						["bone"]                = {4,6,100},
						["rotten-flesh"]        = {3,7,80},
						["bamboo"]              = {1,3,75},
						["saddle"]              = {1,1,15},
						["iron-horse-armor"]    = {1,1,5},
						["golden-horse-armor"]  = {1,1,5},
						["diamond-horse-armor"] = {1,1,5},
						["enchanted-book"]      = {1,1,6}
					}
				},
			},
			poolsBedrockBeta = {},
		},
		["jungle-temple-dispenser"] = { -- jungle_temple_dispenser.json
			chest_type = "dispenser",
			link   = "[[丛林神庙]]",
			structure = "丛林神庙",
			container = "发射器",
			structID = "jungle-temple",
			pools = {
				{
					rolls = {1,2},
					items = {
						["arrow"] = {2,7,30}
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {
				{
					rolls = {2,2},
					items = {
						["arrow"] = {2,7,30}
					}
				},
			},
			poolsBedrockBeta = {}
		},
		["end-city"] = { -- end_city_treasure.json
			header = "[[末地城]]",
			link   = "[[末地城]]",
			structure = "末地城",
			container = "",
			structID = "end-city",
			pools = {
				{
					rolls = {2,6},
					items = {
						["diamond"]             = {2,7,5},
						["iron-ingot"]          = {4,8,10},
						["gold-ingot"]          = {2,7,15},
						["emerald"]             = {2,6,2},
						["beetroot-seeds"]      = {1,10,5},
						["saddle"]              = {1,1,3},
						["iron-horse-armor"]    = {1,1,1},
						["golden-horse-armor"]    = {1,1,1},
						["diamond-horse-armor"] = {1,1,1},
						["enchanted-diamond-sword"]      = {1,1,3},
						["enchanted-diamond-boots"]      = {1,1,3},
						["enchanted-diamond-chestplate"] = {1,1,3},
						["enchanted-diamond-leggings"]   = {1,1,3},
						["enchanted-diamond-helmet"]     = {1,1,3},
						["enchanted-diamond-pickaxe"]    = {1,1,3},
						["enchanted-diamond-shovel"]     = {1,1,3},
						["enchanted-iron-sword"]         = {1,1,3},
						["enchanted-iron-boots"]         = {1,1,3},
						["enchanted-iron-chestplate"]    = {1,1,3},
						["enchanted-iron-leggings"]      = {1,1,3},
						["enchanted-iron-helmet"]        = {1,1,3},
						["enchanted-iron-pickaxe"]       = {1,1,3},
						["enchanted-iron-shovel"]        = {1,1,3},
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["igloo"] = {
			header = "[[雪屋]]",
			link   = "[[雪屋]]",
			structure = "雪屋",
			container = "",
			structID = "igloo",
			pools = {
				{
					rolls = {2,8},
					items = {
						["apple"]               = {1,3,15},
						["coal"]                = {1,4,15},
						["gold-nugget"]         = {1,3,10},
						["stone-axe"]           = {1,1,2},
						["rotten-flesh"]        = {1,1,10},
						["emerald"]             = {1,1,1},
						["wheat"]               = {2,3,10}
					}
				},
				{
					rolls = {1,1},
					items = {
						["golden-apple"]        = {1,1,1},
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["pillager-outpost"] = {
			header = "[[掠夺者前哨站]]",
			link   = "[[掠夺者前哨站]]",
			structure = "掠夺者前哨站",
			container = "",
			structID = "pillager-outpost",
			pools = {},
			poolsDev = {			
				{
					rolls = {0,1},
					items = {
						["crossbow"]             = {1,1,1},
					}
				},
				{
					rolls = {2,3},
					items = {
						["wheat"]                = {3,5,7},
						["potato"]               = {2,5,5},
						["carrot"]               = {3,5,5}
					}
				},
				{
					rolls = {1,3},
					items = {
						["dark-oak-log"]         = {2,3,1}
					}
				},
				{
					rolls = {2,3},
					items = {
						["bottle-o'-enchanting"] = {1,1,7},
						["string"]               = {1,6,4},
						["arrow"]                = {2,7,4},
						["tripwire-hook"]        = {1,3,3},
						["iron-ingot"]           = {1,3,3},
						["enchanted-book-rnd"]   = {1,1,1}
					}
				}
			},
			poolsBedrock = {},
			poolsBedrockBeta = {}
		},
		["woodland-mansion"] = { -- woodland_mansion.json
			header = "[[林地府邸]]",
			link   = "[[林地府邸]]",
			structure = "林地府邸",
			container = "",
			structID = "woodland-mansion",
			pools = {
				{
					rolls = {1,3},
					items = {
						["lead"]                  = {1,1,20},
						["golden-apple"]          = {1,1,15},
						["enchanted-golden-apple"] = {1,1,2},
						["music-disc-13"]               = {1,1,15},
						["music-disc-cat"]              = {1,1,15},
						["name-tag"]              = {1,1,20},
						["chainmail-chestplate"]  = {1,1,10},
						["diamond-hoe"]           = {1,1,15},
						["diamond-chestplate"]    = {1,1,5},
						["enchanted-book-rnd"]    = {1,1,10},
					}
				},
				{
					rolls = {1,4},
					items = {
						["iron-ingot"]            = {1,4,10},
						["gold-ingot"]            = {1,4,5},
						["bread"]                 = {1,1,20},
						["wheat"]                 = {1,4,20},
						["bucket"]                = {1,1,10},
						["redstone"]              = {1,4,15},
						["coal"]                  = {1,4,15},
						["melon-seeds"]           = {2,4,10},
						["pumpkin-seeds"]         = {2,4,10},
						["beetroot-seeds"]        = {2,4,10},
					}
				},
				{
					rolls = {3,3},
					items = {
						["bone"]                  = {1,8,10},
						["gunpowder"]             = {1,8,10},
						["rotten-flesh"]          = {1,8,10},
						["string"]                = {1,8,10},
					}
				},
			},
			poolsDev = {},
			poolsBedrock = {
				{
					rolls = {1,3},
					items = {
						["lead"]                  = {1,1,100},
						["golden-apple"]          = {1,1,75},
						["enchanted-golden-apple"] = {1,1,10},
						["music-disc-13"]               = {1,1,75},
						["music-disc-cat"]              = {1,1,75},
						["name-tag"]              = {1,1,100},
						["chainmail-chestplate"]  = {1,1,50},
						["diamond-hoe"]           = {1,1,75},
						["diamond-chestplate"]    = {1,1,25},
						["enchanted-book-rnd-treasure"] = {1,1,60},
					}
				},
				{
					rolls = {1,4},
					items = {
						["iron-ingot"]            = {1,4,50},
						["gold-ingot"]            = {1,4,25},
						["bread"]                 = {1,1,100},
						["wheat"]                 = {1,4,100},
						["bucket"]                = {1,1,50},
						["redstone"]              = {1,4,75},
						["coal"]                  = {1,4,75},
						["melon-seeds"]           = {2,4,50},
						["pumpkin-seeds"]         = {2,4,50},
						["beetroot-seeds"]        = {2,4,50},
					}
				},
				{
					rolls = {3,3},
					items = {
						["bone"]                  = {1,8,50},
						["gunpowder"]             = {1,8,50},
						["rotten-flesh"]          = {1,8,50},
						["string"]                = {1,8,50},
					}
				},
			},
			poolsBedrockBeta = {}
		},
	},

	-- these values are used:
	-- * in place of the keys, when the key is used as a parameter
	
	-- chest-param -> internally-valid-chest-param
	
	synonyms = {
		["desert"] = "desert-temple",
		["jungle"] = "jungle-temple",
		["nether"] = "nether-fortress",
		["fortress"] = "nether-fortress",

		["blacksmith"] = "village-blacksmith", -- Changed to weaponsmith in 1.14
		
		["armorer"]       = "village-armorer",
		["butcher"]       = "village-butcher",
		["cartographer"]  = "village-cartographer",
		["mason"]         = "village-mason",
		["shepherd"]      = "village-shepherd",
		["tannery"]       = "village-tannery",
		["weaponsmith"]   = "village-weaponsmith",

		["desert-house"]  = "village-desert-house",
		["plains-house"]  = "village-plains-house",
		["savanna-house"] = "village-savanna-house",
		["snowy-house"]   = "village-snowy-house",
		["taiga-house"]   = "village-taiga-house",
		
		["altar"] = "stronghold-altar",
		["storeroom"] = "stronghold-storeroom",
		["library"] = "stronghold-library",
		["outpost"] = "pillager-outpost",
		["mansion"] = "woodland-mansion"
	},

	-- these values are used:
	-- * in the header-description of a table showing only a single chest
	-- * if the key is not here, but it is a valid chest parameter,
	--   that header-description will default to use the key string from p.chests,
	--   e.g. "nether-fortress"
	
	-- chest-param -> description-string
	
	display_names = {
		["nether-fortress"] = "下界要塞",
		["nether"] = "下界要塞",
        ["dungeon"] = "地牢",
		["fortress"] = "下界要塞",
		["desert"] = "沙漠神殿",
		["jungle"] = "丛林神庙",
		["desert-temple"] = "沙漠神殿",
		["jungle-temple"] = "丛林神庙",
        ["igloo"] = "雪屋",
        ["end-city"] = "末地城",
        ["village-two-room-house"] = "村庄两室房屋",
        ["village-blacksmith"] = "村庄铁匠铺",
        ["village"] = "村庄铁匠铺",
        ["blacksmith"] = "村庄铁匠铺",
        ["stronghold-altar"] = "要塞祭坛",
        ["stronghold-storeroom"] = "要塞储藏室",
        ["stronghold-library"] = "要塞图书馆",
        ["altar"] = "要塞祭坛",
        ["storeroom"] = "要塞储藏室",
        ["library"] = "要塞图书馆",
        ["mineshaft"] = "废弃矿井",
        ["woodland-mansion"] = "林地府邸",
        ["jungle-temple-dispenser"] = "丛林神庙发射器",
        ["underwater-ruin-big"] = "水下遗迹大型",
        ["underwater-ruin-small"] = "水下遗迹小型",
        ["shipwreck-supply"] = "沉船补给",
        ["shipwreck-map"] = "沉船地图",
        ["shipwreck-treasure"] = "沉船宝",
        ["buried-treasure"] = "宝藏",
        ["bonus"] = "奖励箱",
        ["pillager-outpost"] = "掠夺者前哨站"
	},
	
	-- these descriptions are used:
	-- * in column <abbr> titles,
	-- * and above the table when only a single column-type is chosen
	
	columns = {
		["stacksize"] = '在这个箱子里能找到的物品一组的数量(对于不可堆叠的物品则为个数)。',
		["weight"] = '这个物品相对于箱子里面的其他物品的权重。',
		["items"] = '预计每个箱子里出现的物品数量,这个数值采用了许多箱子的数据进行平均而得出的。',
		["chance"] = '表示该物品在一个箱子里面出现的几率。',
		["chests"] = '预计为了该物品而要搜索的箱子的数量。'
	},
	
	current_frame = nil
}

p.base = function( ... )

	p.current_frame = mw.getCurrentFrame()

	local args = { ... }
	if args[1] == p.current_frame then 
		args = require( 'Module:ProcessArgs' ).merge( true )
	else
		args = args[1]
	end
	
	-- transform args into usable list
	
	local chests, columns = q.massage_args( args )
	
	if #chests == 0 then
		return "<span style='font-style:italic; color:red;'>模块:LootChest:无有效对象</span>"
	end

	q.fill_in_chest_derivative_data( chests )
	
	-- construct an ordered list dictating the order of the rows
	
	local ordered_item_rows = {}
	local ordered_item_rows_dev = {}
	local ordered_item_rows_bedrock = {}
	local ordered_item_rows_bedrock_beta = {}

	local ret = {}
	
	local java_specified         = args.java         and args.java ~= '0';
	local dev_specified          = args.dev          and args.dev ~= '0';
	local bedrock_specified      = args.bedrock      and args.bedrock ~= '0';
	local bedrock_beta_specified = args.bedrock_beta and args.bedrock_beta ~= '0';
	
	local any_specified = java_specified or dev_specified or bedrock_specified or bedrock_beta_specified
	
	if any_specified then
	
		if java_specified then
			ordered_item_rows = q.construct_ordered_item_rows( chests, '' )
		end	
		if dev_specified then
			ordered_item_rows_dev = q.construct_ordered_item_rows( chests, 'Dev' )
		end	
		if bedrock_specified then
			ordered_item_rows_bedrock = q.construct_ordered_item_rows( chests, 'Bedrock' )
		end	
		if bedrock_beta_specified then
			ordered_item_rows_bedrock_beta = q.construct_ordered_item_rows( chests, 'BedrockBeta' )
		end
	
	else
	
		local java_excluded          = args.java         and args.java == '0';
		local dev_excluded           = args.dev          and args.dev == '0';
		local bedrock_excluded       = args.bedrock      and args.bedrock == '0';
		local bedrock_beta_excluded  = args.bedrock_beta and args.bedrock_beta == '0';
		
		if not java_excluded then
			ordered_item_rows = q.construct_ordered_item_rows( chests, '' )
		end	
		if not dev_excluded then
			ordered_item_rows_dev = q.construct_ordered_item_rows( chests, 'Dev' )
		end	
		if not bedrock_excluded then
			ordered_item_rows_bedrock = q.construct_ordered_item_rows( chests, 'Bedrock' )
		end	
		if not bedrock_beta_excluded then
			ordered_item_rows_bedrock_beta = q.construct_ordered_item_rows( chests, 'BedrockBeta' )
		end
	
	end
	
	if q.tablelength( ordered_item_rows ) > 0 then
		table.insert( ret, q.print_table( chests, columns, ordered_item_rows, '' ) )
	end
	if q.tablelength( ordered_item_rows_dev ) > 0 and q.compare_tables( ordered_item_rows, ordered_item_rows_dev ) then
		table.insert( ret, p.current_frame:preprocess( p.dev ) .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_dev, 'Dev' ) ) )
	end
	if q.tablelength( ordered_item_rows_bedrock ) > 0 and q.compare_tables( ordered_item_rows, ordered_item_rows_bedrock ) then
		table.insert( ret, p.current_frame:preprocess( p.bedrock ) .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_bedrock, 'Bedrock' ) ) .. '[[Category:基岩版独有信息]]' )
	end
	if q.tablelength( ordered_item_rows_bedrock_beta ) > 0 and q.compare_tables( ordered_item_rows, ordered_item_rows_bedrock_beta ) then
		table.insert( ret, p.current_frame:preprocess( p.bedrock_beta ) .. q.lcfirst( q.print_table( chests, columns, ordered_item_rows_bedrock_beta, 'BedrockBeta' ) ) .. '[[Category:基岩版独有信息]]' )
	end
	
	return table.concat( ret, '\n\n' )
end

p.doc = function()

	local valid_args = {}
	for chest_name, val in pairs(p.chests) do
		local synonyms = {}
		for syn, orig in pairs(p.synonyms) do
			if orig == chest_name then
				table.insert( synonyms, syn )
			end
		end
		if #synonyms > 0 then
			chest_name = chest_name .. " ( " .. table.concat( synonyms, ", " ) .. " )"
		end
		table.insert( valid_args, chest_name )
	end
	table.sort( valid_args )
	return table.concat( valid_args, ",\n<br>" )

end

p.doc2 = function()

	local valid_args = {}
	for column_name, val in pairs(p.columns) do
		table.insert( valid_args, column_name .. ": " .. val )
	end
	table.sort( valid_args )
	return table.concat( valid_args, ",\n<br>" )

end

p.doc3 = function()

	local valid_args = {}
	for item_name, val in pairs(p.items) do
		table.insert( valid_args, item_name )
	end
	table.sort( valid_args )
	return table.concat( valid_args, ", " )

end

p.base2 = function( ... )

	p.current_frame = mw.getCurrentFrame()

	local args = { ... }
	if args[1] == p.current_frame then 
		args = require( 'Module:ProcessArgs' ).merge( true )
	else
		args = args[1]
	end
	
	local itemname = args[1]
	
	if p.items[itemname] == nil then
		return '<span style="color:red;">未知物品"' .. itemname .. '"</span>'
	end
	
	if args.java and args.java ~= '0' then
		chances = q.single_item_find_values( itemname, 'pools' )
		devChances = {}
		bedrockChances = {}
		bedrockBetaChances = {}
	else
		if args.dev and args.dev ~= '0' then
			chances = q.single_item_find_values( itemname, 'poolsDev' )
			devChances = {}
			bedrockChances = {}
			bedrockBetaChances = {}
		else
			if args.bedrock and args.bedrock ~= '0' then
				chances = q.single_item_find_values( itemname, 'poolsBedrock' )
				devChances = {}
				bedrockChances = {}
				bedrockBetaChances = {}
			else
				if args.bedrock_beta and args.bedrock_beta ~= '0' then
					chances = q.single_item_find_values( itemname, 'poolsBedrockBeta' )
					devChances = {}
					bedrockChances = {}
					bedrockBetaChances = {}
				else
					chances = q.single_item_find_values( itemname, 'pools' )
					devChances = q.single_item_find_values( itemname, 'poolsDev', chances )
					bedrockChances = q.single_item_find_values( itemname, 'poolsBedrock', chances )
					bedrockBetaChances = q.single_item_find_values( itemname, 'poolsBedrockBeta', chances, bedrockChances )
				end
			end
		end
	end
	
	local html = {}
	
	local any_current = q.tablelength( chances ) > 0
	local any_changes_upcoming = q.tablelength( devChances ) > 0 and q.compare_tables( chances, devChances )
	local any_standard = any_current or any_changes_upcoming
	
	local any_bedrock_current = q.tablelength( bedrockChances ) > 0
	local any_bedrock_upcoming = q.tablelength( bedrockBetaChances ) > 0 and q.compare_tables( bedrockChances, bedrockBetaChances )
	local any_bedrock = any_bedrock_current or any_bedrock_upcoming
	
	local change_case = p.items[itemname].preserve_case == nil or p.items[itemname].preserve_case ~= true

	if any_current then
		table.insert( html, p.base2_sub( itemname, chances ) )
	end
	if any_changes_upcoming then
		table.insert( html, p.current_frame:preprocess( p.dev ) .. ( change_case and q.lcfirst( p.base2_sub( itemname, devChances, any_current ) ) or p.base2_sub( itemname, devChances, any_current ) ) )
	end
	if any_bedrock_current then
		table.insert( html, ( any_standard and '\n\n' or '' ) .. p.current_frame:preprocess( p.bedrock ) .. ( change_case and q.lcfirst( p.base2_sub( itemname, bedrockChances, any_standard ) ) or p.base2_sub( itemname, bedrockChances, any_standard ) ) )
	end
	if any_bedrock_upcoming then
		table.insert( html, ( any_standard and not any_bedrock_current and '\n\n' or '' ) .. p.current_frame:preprocess( p.bedrock_beta ) .. ( change_case and q.lcfirst( p.base2_sub( itemname, bedrockBetaChances, any_bedrock_current or any_standard ) ) or p.base2_sub( itemname, bedrockBetaChances, any_bedrock_current or any_standard ) ) )
	end

	if args.nocat then
	else
		table.insert( html, '[[Category:含LootChest模板的页面]]' )
		if p.items[itemname].category ~= nil and p.items[itemname].category ~= false then
			table.insert( html, '[[Category:含具体LootChest物品的页面]]' )
		end
		if any_bedrock then
			table.insert( html, '[[Category:基岩版独有信息]]' )
		end
	end
	
	return table.concat( html, ' ' )
end

p.base2_sub = function( itemname, chances, use_they )

	local html = {}
	local item_display_name = ''
	
	if use_they then
		item_display_name = '其'
	else
		if p.items[itemname].plural ~= nil and p.items[itemname].plural ~= false then
			item_display_name = p.items[itemname].plural
		else
			if p.items[itemname].title ~= nil then
				item_display_name = p.items[itemname].title
			else
				item_display_name = string.gsub( itemname, '-', ' ' )
			end
			if p.items[itemname].plural == nil or p.items[itemname].plural ~= false then
				item_display_name = q.single_item_plural( item_display_name )
			end
		end
		
		if p.items[itemname].preserve_case == nil or p.items[itemname].preserve_case ~= true then
			item_display_name = q.capitalize( item_display_name )
		end
		
		if p.items[itemname].note and p.notes[p.items[itemname].note] then
			item_display_name = item_display_name .. p.current_frame:preprocess( p.notes[p.items[itemname].note] )
		end
	end
	
	local Autolink = require( 'Module:Autolink' )
	table.insert( html, Autolink.invlink( item_display_name, 'nolink' ) )

	local html_stacks = {}
	local stack_sep = ', '
	local ns = q.tablelength( chances )
	local s = 0

	for stacksize, chest_details in pairs( chances ) do
		s = s + 1
	
		local html_per_stack = { '' }
		local c = 0
		local nc = q.tablelength( chest_details )
		local sep = ( nc > 2 and ',' or '' )
		if nc > 2 and s ~= ns then
			stack_sep = ';'
		end
		for k, chest in pairs( chest_details ) do
			c = c + 1
			if c == nc and nc > 1 then
				table.insert( html_per_stack, '并且' )
			end
			if chest.chance == 1 then
				table.insert( html_per_stack, "所有的" )
			else
				table.insert( html_per_stack, "有" )
				table.insert( html_per_stack, string.format("%.1f", chest.chance*100) )
				table.insert( html_per_stack, "%概率会在" )
			end
			if chest.chest_type == 'minecart with chest' then
				table.insert( html_per_stack, p.chests[chest.chest_name].link )
				table.insert( html_per_stack, '的[[运输矿车]]里' )
			elseif chest.chest_type == 'dispenser' then
				table.insert( html_per_stack, p.chests[chest.chest_name].link )
				table.insert( html_per_stack, '的[[发射器]]里' )
			else
				table.insert( html_per_stack, p.chests[chest.chest_name].link )
				table.insert( html_per_stack, '的箱子里' )
			end
			table.insert( html_per_stack, sep )
		end
		if nc > 2 then
			table.insert( html_per_stack, '皆' )
		end
		table.insert( html_per_stack, '以' )
		table.insert( html_per_stack, stacksize )
        if p.items[itemname].cannot_stack == nil then
           table.insert( html_per_stack, '份' )
        else
           table.insert( html_per_stack, '份单独')
        end
	    table.insert( html_per_stack, '为一组的形式出现' )
		table.insert( html_stacks, table.concat( html_per_stack ) )
	end
	
	local stackwise_summaries = ''
	if #html_stacks == 1 then
		table.insert( html, html_stacks[1] )
	else
		for i = 1, #html_stacks - 1 do
			table.insert( html, html_stacks[ i ] )
			table.insert( html, stack_sep ) 
		end
		table.insert( html, '也会在' )
		table.insert( html, html_stacks[#html_stacks] )
	end
	
	table.insert( html, '。' )
	
	return table.concat( html )
	
end

p.base2_test = function()

	items = {}
	for item_name, v in pairs( p.items ) do
		table.insert( items, p.base2{ item_name, ["nocat"]=true } .. '\n\n' )
	end

	table.sort( items )
	
	return table.concat(items)
end


p.base3 = function( ... )

	p.current_frame = mw.getCurrentFrame()

	local args = { ... }
	if args[1] == p.current_frame then 
		args = require( 'Module:ProcessArgs' ).merge( true )
	else
		args = args[1]
	end
	
	local z = args[1]
	
	local html = {}
	local html_dev = {}
	local html_bedrock = {}
	local html_beta = {}
	
	local rErr = ""
	
	local zT = {}
	if args[1] == "!!!ALL!!!" then
		for item_name, v in pairs( p.items ) do
			table.insert( zT, item_name )
			table.sort( zT )
		end
	else
		zT = mw.text.split( args[1], ',' )
	end
	
	for x, itemname in pairs( zT ) do
	
		if p.items[itemname] == nil then
			rErr = rErr .. "<span class='error'>Unknown item " .. itemname .. ".</span>\n"
		else
			
			local chances, devChances, bedrockChances, bedrockBetaChances
			
			if args.java and args.java ~= '0' then
				chances = q.single_item_find_values( itemname, 'pools' )
				devChances = {}
				bedrockChances = {}
				bedrockBetaChances = {}
			else
				if args.dev and args.dev ~= '0' then
					chances = q.single_item_find_values( itemname, 'poolsDev' )
					devChances = {}
					bedrockChances = {}
					bedrockBetaChances = {}
				else
					if args.bedrock and args.bedrock ~= '0' then
						chances = q.single_item_find_values( itemname, 'poolsBedrock' )
						devChances = {}
						bedrockChances = {}
						bedrockBetaChances = {}
					else
						if args.bedrock_beta and args.bedrock_beta ~= '0' then
							chances = q.single_item_find_values( itemname, 'poolsBedrockBeta' )
							devChances = {}
							bedrockChances = {}
							bedrockBetaChances = {}
						else
							chances = q.single_item_find_values( itemname, 'pools' )
							devChances = q.single_item_find_values( itemname, 'poolsDev', chances )
							bedrockChances = q.single_item_find_values( itemname, 'poolsBedrock', chances )
							bedrockBetaChances = q.single_item_find_values( itemname, 'poolsBedrockBeta', chances, bedrockChances )
						end
					end
				end
			end
			
			local any_current = q.tablelength( chances ) > 0
			local any_changes_upcoming = q.tablelength( devChances ) > 0 and q.compare_tables( chances, devChances )
			local any_standard = any_current or any_changes_upcoming
			
			local any_bedrock_current = q.tablelength( bedrockChances ) > 0
			local any_bedrock_upcoming = q.tablelength( bedrockBetaChances ) > 0 and q.compare_tables( bedrockChances, bedrockBetaChances )
			local any_bedrock = any_bedrock_current or any_bedrock_upcoming
			
			if any_current then
				table.insert( html, p.base3_sub( itemname, chances ) )
			end
			if any_changes_upcoming then
				table.insert( html_dev, p.base3_sub( itemname, devChances ) )
			end
			if any_bedrock_current then
				table.insert( html_bedrock, p.base3_sub( itemname, bedrockChances ) )
			end
			if any_bedrock_upcoming then
				table.insert( html_beta, p.base3_sub( itemname, bedrockBetaChances ) )
			end
			
		end	
	end
	
	local output = rErr .. '{| class="wikitable sortable" \n! Item \n! Structure \n! Container \n! Quantity \n! Chance \n' .. table.concat( html )
	if q.tablelength( html_dev ) > 0 then
		output = output .. '|-\n!colspan=5|' .. p.dev .. ' \n' .. table.concat( html_dev ) 
	end
	if q.tablelength( html_bedrock ) > 0 then
		output = output .. '|-\n!colspan=5|' .. p.bedrock .. ' \n' .. table.concat( html_bedrock ) 
	end
	if q.tablelength( html_beta ) > 0 then
		output = output .. '|-\n!colspan=5|' .. p.bedrock_beta .. ' \n' .. table.concat( html_beta ) 
	end
	output = output .. '|}' .. p.current_frame:extensionTag( 'references', "", { group="note" } )
	
	return output
end

p.base3_sub = function( itemname, chances )
	local html = {}
	local item_display_name = ''
	local output = ""
	lang = mw.getContentLanguage()
	
	if p.items[itemname].title ~= nil then
		item_display_name = p.items[itemname].title
	else
		item_display_name = q.titlecase( string.gsub( itemname, '-', ' ' ) )
	end
	
	local objectList = {}
	local ns = q.tablelength( chances )
	local s = 0
	local m = 0
	
	local rn = 0

	for stacksize, chest_details in pairs( chances ) do
		s = s + 1
		
		local nc = q.tablelength( chest_details )
		local c = 0
		for k, chest in pairs( chest_details ) do
			c = c + 1
			rn = rn + 1
			local r = ""
			
			r = r .. '|' .. p.chests[chest.chest_name].container  .. '\n|' .. stacksize .. '\n|' .. lang:formatNum( math.floor( chest.chance*1000 + 0.5 ) /10 ) .. ' %' .. '\n'
			if ns ~= s or nc ~= c then
				r = r 
			end
			
			table.insert( objectList , { p.chests[chest.chest_name].structID , p.chests[chest.chest_name].structure, r } )
			
		end
		m = m + nc
	end
	table.sort( objectList, function(a,b) return a[1] < b[1] end )
	local struct = ""
	local t = ""
	local nt = 1
	local ntt = 0
	for v, w  in pairs( objectList ) do
		ntt = ntt + 1
		if w[1] ~= struct then
			if t ~= "" then
				output = output .. "|rowspan=" .. nt .. t
			end
			t = "|'''" .. p.current_frame:expandTemplate{ title = 'EnvLink', args = { w[2], id = w[1] } } .. "'''\n" .. w[3]
			struct = w[1]
			nt = 1
		else
			t = t .. w[3]
			nt = nt + 1
		end
		if ntt == m then
			output = output .. "|rowspan=" .. nt .. t
		else
			t = t .. '|-' .. '\n'
		end
	end

	return "|-\n| rowspan=" .. m .. "|'''" .. p.getItem(itemname, item_display_name) .. "'''\n" .. output
	
end

p.getItem = function( itemname, item_display_name )
	local s = ""
	local k = item_display_name
	local link = item_display_name
	local m = itemname
	
	if p.items[itemname].title ~= nil then
		k = p.items[itemname].title
	end
	if p.items[itemname].link ~= nil then
		link = p.items[itemname].link
	end
	if p.items[itemname].id ~= nil then
		m = p.items[itemname].id
	end
	
	if p.items[itemname][1] == "item" then
		s = p.current_frame:expandTemplate{ title = 'ItemLink', args = { link , k , id = m } }
	elseif p.items[itemname][1] == "block" then
		s = p.current_frame:expandTemplate{ title = 'BlockLink', args = { link , k , id = m } }
	end
	if p.items[itemname].note ~= nil and p.items[itemname].note ~= "" then
		s = s .. p.current_frame:extensionTag( 'ref', p.notes3[p.items[itemname].note], { group='note', name=p.items[itemname].note } )
	end
	return s
	
end


q = {

	tablelength = function(T)
		local count = 0
		for _ in pairs(T) do count = count + 1 end
		return count
	end,
	
	deepcopy = function(orig)
	    local orig_type = type(orig)
	    local copy
	    if orig_type == 'table' then
	        copy = {}
	        for orig_key, orig_value in next, orig, nil do
	            copy[q.deepcopy(orig_key)] = q.deepcopy(orig_value)
	        end
	        setmetatable(copy, q.deepcopy(getmetatable(orig)))
	    else -- number, string, boolean, etc
	        copy = orig
	    end
	    return copy
	end,
	
	single_item_find_values = function( itemname, poolsKey, exclusions_param, other_exclusions_param )
	
		local chances = {}
		
		local exclusions = q.deepcopy(exclusions_param or {})
		local other_exclusions = q.deepcopy(other_exclusions_param or {})
		
		for stacksize, other_exclusion_list in pairs(other_exclusions) do
			if exclusions[stacksize] == nil then
				exclusions[stacksize] = {}
			end 
			for _, other_exclusion in pairs(other_exclusion_list) do
				local already_in_here = false
				for _, exclusion in pairs(exclusions[stacksize]) do
					if exclusion["chest_name"] == other_exclusion["chest_name"] and exclusion["chance"] == other_exclusion["chance"] then
						already_in_here = true
						break 
					end
				end
				if not already_in_here then
					table.insert( exclusions[stacksize], other_exclusion )
				end 
			end
		end

		for chest_name, chest in pairs( p.chests ) do
			local poolchances = {}
			for k, pool in pairs( chest[poolsKey] or chest.pools or {} ) do
				local poolitem = pool.items[itemname]
				if poolitem ~= nil then
				
					local stacksize = poolitem[1]
					if poolitem[1] ~= poolitem[2] then
						stacksize = stacksize .. "–" .. poolitem[2]
					end
					
					local itemweight = poolitem[3]
					
					local pool_total_item_weight = 0
					for itemname, item in pairs(pool.items) do
						pool_total_item_weight = pool_total_item_weight + item[3]
					end
				
					local chance = p.calc_chance_any_of_this_item_per_pool( 
						pool.rolls[1], pool.rolls[2],
						itemweight, pool_total_item_weight )

					if poolchances[stacksize] == nil then
						poolchances[stacksize] = chance
					else
						poolchances[stacksize] = poolchances[stacksize] + (1 - poolchances[stacksize]) * chance
					end
				end
			end
			for stacksize, chance in pairs( poolchances ) do
				local excluded = false
				for _, exclusion in pairs( exclusions[stacksize] or {} ) do
					if exclusion["chest_name"] == chest_name and exclusion["chance"] == chance then
						excluded = true
						break 
					end
				end
				if not excluded then
					if chances[stacksize] == nil then
						chances[stacksize] = {}
					end
					table.insert( chances[stacksize], { ["chance"]=chance, ["chest_name"]=chest_name, ["chest_type"]=( chest.chest_type or "chest" ) } )
				end
			end
		end

		return chances
		
	end,
	
	single_item_plural = function( itemname )
		return itemname
	
	end,
	
	massage_args = function( args )

		-- find what columns to put
		
		local columns = {}
		
		for k, _arg in pairs(args) do
			if p.columns[_arg] ~= nil then
				columns[_arg] = true
			end
		end
		
		if q.tablelength(columns) == 0 then
			for column_name, v in pairs(p.columns) do
				columns[column_name] = true
			end
		end
		
		-- find what chests to show

		local chests = {}
		
		for k, _arg in pairs(args) do
			if p.chests[_arg] ~= nil then
				table.insert( chests, _arg )
			elseif p.synonyms[_arg] ~= nil then 
				table.insert( chests, p.synonyms[_arg] )
			end
			if p.display_names[_arg] ~= nil then
				local chestname = _arg
				if p.chests[chestname] == nil then 
					chestname = p.synonyms[_arg]
				end
				p.chests[chestname].display_name = p.display_names[_arg]
			end
		end
		
		if #chests == 0 then
			for chest_name, chest in pairs(p.chests) do
				local chest_type = ( chest.chest_type or "chest" )
				if chest_type == "chest" or chest_type == "minecart with chest" then
					table.insert( chests, chest_name )
				end
			end
		end
		
		table.sort( chests )
		
		return chests, columns
		
	end,

	sort_items = function( e1, e2 )
		
		if e1.chanceany ~= e2.chanceany then return ( e1.chanceany > e2.chanceany ) end
		if e1.avgamount ~= e2.avgamount then return ( e1.avgamount > e2.avgamount ) end
		
		if e1.material == nil then
			
			e1.material = 0
			if string.find( e1.itemname, "leather" ) ~= nil then e1.material = 1 end
			if string.find( e1.itemname, "iron" ) ~= nil then e1.material = 2 end
			if string.find( e1.itemname, "gold" ) ~= nil then e1.material = 3 end
			if string.find( e1.itemname, "diamond" ) ~= nil then e1.material = 4 end
			e1.armor = 0
			if string.find( e1.itemname, "helmet" ) ~= nil or string.find( e1.itemname, "cap" ) ~= nil then e1.armor = 1 end
			if string.find( e1.itemname, "chestplate" ) ~= nil or string.find( e1.itemname, "tunic" ) ~= nil then e1.armor = 2 end
			if string.find( e1.itemname, "leggings" ) ~= nil or string.find( e1.itemname, "pants" ) ~= nil then e1.armor = 3 end
			if string.find( e1.itemname, "boots" ) ~= nil then e1.armor = 4 end
			
		end
		
		if e2.material == nil then
			
			e2.material = 0
			if string.find( e2.itemname, "leather" ) ~= nil then e2.material = 1 end
			if string.find( e2.itemname, "iron" ) ~= nil then e2.material = 2 end
			if string.find( e2.itemname, "gold" ) ~= nil then e2.material = 3 end
			if string.find( e2.itemname, "diamond" ) ~= nil then e2.material = 4 end
			e2.armor = 0
			if string.find( e2.itemname, "helmet" ) ~= nil or string.find( e2.itemname, "cap" ) ~= nil then e2.armor = 1 end
			if string.find( e2.itemname, "chestplate" ) ~= nil or string.find( e2.itemname, "tunic" ) ~= nil then e2.armor = 2 end
			if string.find( e2.itemname, "leggings" ) ~= nil or string.find( e2.itemname, "pants" ) ~= nil then e2.armor = 3 end
			if string.find( e2.itemname, "boots" ) ~= nil then e2.armor = 4 end
		
		end
		
		if e1.material ~= e2.material then return ( e1.material < e2.material ) end
		if e1.armor ~= e2.armor then return ( e1.armor < e2.armor ) end
		
		return ( e1.itemname < e2.itemname )
		
	end,
	
	fill_in_chest_derivative_data = function( chest_names )

		for k, chest_name in pairs(chest_names) do
			local chest = p.chests[chest_name]
			if chest == nil then break end

			chest.allRolls = {}
			chest.itemData = {}
			for k, pool in pairs( chest.pools or {} ) do
				table.insert( chest.allRolls, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..'–'..pool.rolls[2] ) )

				local total_weight = 0
				for itemname, item in pairs(pool.items) do
					total_weight = total_weight + item[3]
				end
				pool.totalweight = total_weight

				q.fill_in_chest_item_details( chest.itemData, pool, #chest.allRolls )
			end

			chest.allRollsDev = {}
			chest.itemDataDev = {}
			for k, pool in pairs( chest.poolsDev or chest.pools or {} ) do
				table.insert( chest.allRollsDev, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..'–'..pool.rolls[2] ) )

				local total_weight = 0
				for itemname, item in pairs(pool.items) do
					total_weight = total_weight + item[3]
				end
				pool.totalweight = total_weight

				q.fill_in_chest_item_details( chest.itemDataDev, pool, #chest.allRollsDev )
			end

			chest.allRollsBedrock = {}
			chest.itemDataBedrock = {}
			for k, pool in pairs( chest.poolsBedrock or chest.pools or {} ) do
				table.insert( chest.allRollsBedrock, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..'–'..pool.rolls[2] ) )

				local total_weight = 0
				for itemname, item in pairs(pool.items) do
					total_weight = total_weight + item[3]
				end
				pool.totalweight = total_weight

				q.fill_in_chest_item_details( chest.itemDataBedrock, pool, #chest.allRollsBedrock )
			end

			chest.allRollsBedrockBeta = {}
			chest.itemDataBedrockBeta = {}
			for k, pool in pairs( chest.poolsBedrockBeta or chest.pools or {} ) do
				table.insert( chest.allRollsBedrockBeta, ( pool.rolls[1] == pool.rolls[2] and pool.rolls[1] or pool.rolls[1]..'–'..pool.rolls[2] ) )

				local total_weight = 0
				for itemname, item in pairs(pool.items) do
					total_weight = total_weight + item[3]
				end
				pool.totalweight = total_weight

				q.fill_in_chest_item_details( chest.itemDataBedrockBeta, pool, #chest.allRollsBedrockBeta )
			end
		end
	end,

	fill_in_chest_item_details = function( data, pool, ct )
		for item_name, item in pairs(pool.items) do
			if p.items[item_name] then
				local min_stacksize = item[1]
				local max_stacksize = item[2]
				local min_pool_rolls = pool.rolls[1]
				local max_pool_rolls = pool.rolls[2]
				local item_weight = item[3]
			
				if data[item_name] == nil then
					data[item_name] = {
						avgamount = 0,
						chanceany = 0,
						itemname = item_name,
						sortsize = {},
						sortweight = {},
						sizes = {},
						weights = {},
					}
					for i = 1, ct-1 do
						data[item_name].sortsize[i] = 0
						data[item_name].sortweight[i] = 0
						data[item_name].sizes[i] = '—'
						data[item_name].weights[i] = '—'
					end
				end

				data[item_name].avgamount = data[item_name].avgamount + p.calc_average_amount_this_item_per_pool( 
					min_stacksize, max_stacksize, 
					min_pool_rolls, max_pool_rolls, 
					item_weight, pool.totalweight )
					
				data[item_name].chanceany = data[item_name].chanceany + (1 - data[item_name].chanceany) * p.calc_chance_any_of_this_item_per_pool(
					min_pool_rolls, max_pool_rolls, 
					item_weight, pool.totalweight )

				data[item_name].sortsize[ct] = ( min_stacksize + max_stacksize ) / 2
				data[item_name].sortweight[ct] = item_weight;
				data[item_name].sizes[ct] = ( min_stacksize == max_stacksize and min_stacksize or min_stacksize .. '–' .. max_stacksize )
				data[item_name].weights[ct] = p.current_frame:expandTemplate{ title = 'frac', args = { item_weight, pool.totalweight } }
			end
		end

		for item_name, d in pairs(data) do
			if not d.sizes[ct] then
				d.sortsize[ct] = 0
				d.sortweight[ct] = 0
				d.sizes[ct] = '—'
				d.weights[ct] = '—'
			end
		end
	end,

	construct_ordered_items_from_first_chest = function( chest_names, suffix )
		local items_from_first_table = {}
		local item_chests = {}
		local item_names_ordered = {}
		for item_name, item in pairs( p.chests[chest_names[1]]['itemData'..suffix] ) do
			table.insert( items_from_first_table, item )
		end
		
		table.sort( items_from_first_table, q.sort_items )
		
		for k, item in pairs( items_from_first_table ) do
			table.insert( item_names_ordered, item.itemname )
			item_chests[item.itemname] = true
		end
		
		return item_names_ordered, item_chests
	end,

	get_ordered_items_from_other_chests = function( chest_names, item_chests, suffix )
		local items_not_from_first_table = {}
		
		for chest_idx = 2, #chest_names do
			for item_name, item in pairs( p.chests[chest_names[chest_idx]]['itemData'..suffix] ) do
				if item_chests[item_name] == nil then
					p.items[item_name].itemname = item_name
					table.insert( items_not_from_first_table, p.chests[chest_names[chest_idx]]['itemData'..suffix][item_name] )
					item_chests[item_name] = true
				end
			end
		end

		table.sort( items_not_from_first_table, q.sort_items )
		
		return items_not_from_first_table
	end,

	add_other_items_to_first_list = function( chest_names, item_names_ordered, item_chests, items_not_from_first_table )
		for k, item in pairs( items_not_from_first_table ) do
			table.insert( item_names_ordered, item.itemname )
		end
		
		return item_names_ordered
	end,

	set_up_ordered_item_rows = function( chest_names, item_names_ordered, suffix )
		for k, itemname in pairs(item_names_ordered) do
			item_names_ordered[k] = {itemname}
			for chest_idx = 1, #chest_names do
				if suffix == 'Dev' or p.chests[chest_names[chest_idx]]['pools'..suffix] ~= nil then
					local item_data = p.chests[chest_names[chest_idx]]['itemData'..suffix][itemname]
					if item_data == nil then
						table.insert( item_names_ordered[k], false )
					else
						table.insert( item_names_ordered[k], item_data )
					end				
				end
			end
		end

		return item_names_ordered
	end,

	construct_ordered_item_rows = function( chest_names, suffix )
		-- for the first chest, sort its by chance desc, then by avg amount desc, then alphabetically asc
		local item_names_ordered, item_chests = q.construct_ordered_items_from_first_chest( chest_names, suffix )
		
		if #chest_names > 1 then
			-- after that, sort all the remaining items in list order
			local items_not_from_first_table = q.get_ordered_items_from_other_chests( chest_names, item_chests, suffix )
			item_names_ordered = q.add_other_items_to_first_list( chest_names, item_names_ordered, item_chests, items_not_from_first_table )
		end

		-- set up item_names_ordered so that each is a row, representing chest values
		item_names_ordered = q.set_up_ordered_item_rows( chest_names, item_names_ordered, suffix )
		
		return item_names_ordered
	end,

	print_table = function( chest_names, columns, ordered_item_rows, suffix )

		local html = {}
		
		local use_roll_row = false
		local use_superheader = false
		local superheader_sizes = {}
		for i = 1, #chest_names do
			sh = p.chests[chest_names[i]].superheader
			if sh ~= nil then
				if superheader_sizes[sh] == nil then
					superheader_sizes[sh] = 0
				end
				superheader_sizes[sh] = superheader_sizes[sh] + 1
				use_superheader = true
			end
			local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
			if #allRolls > 1 then
				use_roll_row = true
			end
		end
		if columns['stacksize'] == nil and columns['weight'] == nil then
			use_roll_row = false
		end
		
		local rowspan = ( #chest_names > 1 and 1 or 0 ) + ( use_superheader and 1 or 0 ) + 1
		local hide_col_description = rowspan > 1 and q.tablelength(columns) == 1
		if use_roll_row then
			rowspan = rowspan + 1
		end
		
		if q.tablelength(columns) == 1 then
			for column_name, v in pairs(columns) do
				table.insert( html, "Values represent " )
				table.insert( html, p.columns[column_name] )
				table.insert( html, "\n" )
			end
		end

		if #chest_names == 1 then
		
			if q.tablelength(columns) == 1 then
				table.insert( html, "<br>" )
			end
		
			local chest_name = chest_names[1]
			local allRolls = p.chests[chest_name]['allRolls'..suffix]
			local chest_type = p.chests[chest_name].chest_type or "chest"

			local display_name = p.chests[chest_name].display_name

			chest_name = chest_name:gsub( "-", " " )
			
			table.insert( html, "每个" )
			table.insert( html, display_name or chest_name )
			if chest_type ~= 'chest' and chest_type ~= 'minecart with chest' then
				table.insert( html, "" )
			else
				table.insert( html, "箱子" )
			end
			if #allRolls == 1 then
				table.insert( html, '都含有' )
				table.insert( html, allRolls[1] )
				table.insert( html, "叠物品" )
			else
				table.insert( html, '的内含物都从' )
				table.insert( html, #allRolls )
				table.insert( html, '个物品池中随机抓取' )
			end
			table.insert( html, ",分布情况如下:\n" )
		end
		
		table.insert( html, '<div style="overflow:auto">\n' )
		table.insert( html, "<table class='wikitable sortable jquery-tablesorter'>\n" )
		table.insert( html, "<tr>\n" )
		table.insert( html, "<th rowspan=" )
		table.insert( html, ( rowspan - ( hide_col_description and 1 or 0 ) ) )
		table.insert( html, "></th>\n" )
		
		local superheader_cols_used = {}
		
		if #chest_names > 1 then
			local row1, row2 = {}, {}

			for i = 1, #chest_names do
			
				if suffix == 'Dev' or p.chests[chest_names[i]]['pools'..suffix] ~= nil then
					local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
					local colspan = q.tablelength(columns)
					local allRollsSpan = #allRolls == 0 and 1 or #allRolls
					if columns['stacksize'] ~= nil then
						colspan = colspan - 1 + allRollsSpan
					end
					if columns['weight'] ~= nil then
						colspan = colspan - 1 + allRollsSpan
					end
					local row = row1
					
					rowspan = 1
					if use_superheader then
						sh = p.chests[chest_names[i]].superheader
						if sh ~= nil then
							if superheader_cols_used[sh] == nil then
								table.insert( row, "<th colspan=" )
								table.insert( row, ( colspan * superheader_sizes[sh] ) )
								table.insert( row, ">" )
								table.insert( row, sh )
								table.insert( row, "</th>\n" )
								superheader_cols_used[sh] = 0
							end
							row = row2
						else
							rowspan = rowspan + 1
						end
					end
					if use_roll_row and hide_col_description and #allRolls < 2 then
						rowspan = rowspan + 1
					end

					table.insert( row, "<th colspan=" )
					table.insert( row, colspan )
					if rowspan > 1 then
						table.insert( row, " rowspan=" )
						table.insert( row, rowspan )
					end
					table.insert( row, ">" )
					table.insert( row, p.chests[ chest_names[i] ].header )
					if #allRolls > 0 then
						table.insert( row, ' <br><span style="font-weight:normal; font-style:italic; font-size:11px;">(' )
						if #allRolls == 1 then
							table.insert( row, allRolls[1] )
						else
							local s = ( #allRolls > 2 and ', ' or ' ' )
							for i = 1, #allRolls-1 do
								table.insert( row, allRolls[i] )
								table.insert( row, s )
							end
							table.insert( row, 'and ' )
							table.insert( row, allRolls[#allRolls] )
						end
						table.insert( row, ' stacks)</span>' )
					end
					table.insert( row, "</th>\n" )
				end
			end
			
			table.insert( html, table.concat( row1 ) )
			table.insert( html, "</tr><tr>\n" )
			if #row2 then
				table.insert( html, table.concat( row2 ) )
				table.insert( html, "</tr><tr>\n" )
			end
		end

		if not hide_col_description then
			local headersort_th_open
			if use_roll_row then
				headersort_th_open = "<th rowspan='2' class='headersort' role='columnheader button' data-sort-type='number'> <abbr title='"
			else
				headersort_th_open = "<th class='headersort' role='columnheader button' data-sort-type='number'> <abbr title='"
			end
			for i = 1, #chest_names do
				if suffix == 'Dev' or p.chests[chest_names[i]]['pools'..suffix] ~= nil then
					local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
					local allRollsSpan = #allRolls == 0 and 1 or #allRolls
					local headersort_th_colspan_open
					if #allRolls > 1 then
						headersort_th_colspan_open = "<th colspan='" .. allRollsSpan .. "' role='columnheader'> <abbr title='"
					else
						headersort_th_colspan_open = headersort_th_open
					end

					if columns['stacksize'] ~= nil then
						table.insert( html, headersort_th_colspan_open )
						table.insert( html, p.columns['stacksize'] )
						table.insert( html, "'> 堆叠数 </abbr></th>\n" )
					end
					if columns['weight'] ~= nil then
						table.insert( html, headersort_th_colspan_open )
						table.insert( html, p.columns['weight'] )
						table.insert( html, "'> 权重" )
						table.insert( html, "</abbr></th>\n" )
					end
					if columns['items'] ~= nil then
						table.insert( html, headersort_th_open )
						table.insert( html, p.columns['items'] )
						table.insert( html, "'> 物品数 </abbr></th>\n" )
					end
					if columns['chance'] ~= nil then
						table.insert( html, headersort_th_open )
						table.insert( html, p.columns['chance'] )
						table.insert( html, "'> 几率 </abbr></th>\n" )
					end
					if columns['chests'] ~= nil then
						table.insert( html, headersort_th_open )
						table.insert( html, p.columns['chests'] )
						table.insert( html, "'> 箱子数 </abbr></th>\n" )
					end
				end
			end
			table.insert( html, "</tr><tr>\n" )
		end
		
		if use_roll_row then
			local rowcols = ( columns['stacksize'] ~= nil and 1 or 0 ) + ( columns['weight'] ~= nil and 1 or 0 )
			for i = 1, #chest_names do
				local allRolls = p.chests[chest_names[i]]['allRolls'..suffix]
				if #allRolls > 1 then
					for j = 1, rowcols do
						for k = 1, #allRolls do
							table.insert( html, "<th class='headersort' role='columnheader button' data-sort-type='number' style='font-weight:normal'><abbr title='箱子会从本池中随机抓取" )
							table.insert( html, allRolls[k] )
							table.insert( html, "叠物品。'>" )
							table.insert( html, allRolls[k] )
							table.insert( html, "×</abbr></th>\n" )
						end
					end
				end
			end
			table.insert( html, "</tr><tr>\n" )
		end

		for i = 1, #ordered_item_rows do
			if type( ordered_item_rows[i] ) == "table" then
				for j = 1, #ordered_item_rows[i] do

					local chest_item = ordered_item_rows[i][j]
					
					if type( chest_item ) == "table" then
					
						local avg_amount = string.format("%.3f", chest_item.avgamount)
						local chance_any = string.format("%.1f", chest_item.chanceany*100) .. "%"
						local num_chests = string.format("%.1f", 1/chest_item.chanceany)
						
						table.insert( html, "\n" )
						if columns['stacksize'] ~= nil then
							for k = 1, #chest_item.sizes do
								table.insert( html, "<td style='text-align:center;' data-sort-value='" )
								table.insert( html, ( chest_item.sortsize[k] == 0 and "9e99" or chest_item.sortsize[k] ) )
								table.insert( html, "'>" )
								table.insert( html, chest_item.sizes[k] )
								table.insert( html, "</td>" )
							end
						end
						if columns['weight'] ~= nil then
							for k = 1, #chest_item.sizes do
								table.insert( html, "<td style='text-align:center;' data-sort-value='" )
								table.insert( html, ( chest_item.sortweight[k] == 0 and "9e99" or chest_item.sortweight[k] ) )
								table.insert( html, "'>" )
								table.insert( html, chest_item.weights[k] )
								table.insert( html, "</td>" )
							end
						end
						if columns['items'] ~= nil then
							table.insert( html, "<td style='text-align:center;'>" )
							table.insert( html, avg_amount )
							table.insert( html, "</td>" )
						end
						if columns['chance'] ~= nil then
							table.insert( html, "<td style='text-align:right;'>" )
							table.insert( html, chance_any )
							table.insert( html, "</td>" )
						end
						if columns['chests'] ~= nil then
							table.insert( html, "<td style='text-align:right;'>" )
							table.insert( html, num_chests )
							table.insert( html, "</td>" )
						end
							
					elseif type( chest_item ) == "boolean" then
						local allRolls = p.chests[chest_names[j-1]]['allRolls'..suffix]
						local allRollsSpan = #allRolls == 0 and 1 or #allRolls

						table.insert( html, "\n" )
						if columns['stacksize'] ~= nil then
							for k = 1, allRollsSpan do
								table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
							end
						end
						if columns['weight'] ~= nil then
							for k = 1, allRollsSpan do
								table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
							end
						end
						if columns['items'] ~= nil then
							table.insert( html, "<td data-sort-value='9e99' style='text-align:center;'>—</td>" )
						end
						if columns['chance'] ~= nil then
							table.insert( html, "<td data-sort-value='9e99' style='text-align:right;'>—</td>" )
						end
						if columns['chests'] ~= nil then
							table.insert( html, "<td data-sort-value='9e99' style='text-align:right;'>—</td>" )
						end
					else
						if i > 1 then
							table.insert( html, "</tr><tr>" )
						end
						
						local item = p.items[chest_item]
						
						local s = require( 'Module:Sprite' )
						table.insert( html, "\n<td>" )
						local image, spriteCat = s.link{ 
							id=item.id or chest_item, 
							link=item.link or string.gsub(chest_item,'-',' '), 
							text=item.title or q.titlecase(string.gsub(chest_item,'-',' ')), 
							data= ( item[1] == 'item' and 'ItemSprite' or 'BlockSprite' )
						}
						table.insert( html, image )
						table.insert( html, spriteCat )
						if item.note and p.notes[item.note] then
							table.insert( html, p.current_frame:preprocess( p.notes[item.note] ) )
						end
						table.insert( html, "</td>" )
					end
					
					if j == #ordered_item_rows[i] then
						table.insert( html, "</tr>" )
					end
					
				end
				table.insert( html, "\n" )
			end
		end
		
		table.insert( html, "</table></div>" )
		
		return table.concat( html )
		
	end,
	
	titlecase = function( str )
		local buf = {}
		for word in string.gfind(str, "%S+") do
			if word == "and" then
				table.insert( buf, word )
			else
				local first, rest = string.sub( word, 1, 1 ), string.sub( word, 2 )
				table.insert( buf, string.upper(first) .. string.lower(rest) )
			end
		end    
		return table.concat( buf, " " )
	end,
	
	capitalize = function( str )
		return ( string.lower(str):gsub( "^%l", string.upper ) )
	end,

	lcfirst = function( str )
		return ( string.gsub( str, "^%u", string.lower ) )
	end,
	
	compare_tables = function( a, b )
		local seen = {}
		for k, v in pairs( a ) do
			if type( v ) ~= type( b[k] ) then
				return true
			end
			if v ~= b[k] then
				return true
			end
			if type( v ) == 'table' and q.compare_tables( v, b[k] ) then
				return true
			end
			seen[k] = true
		end
		for k, v in pairs( b ) do
			if not seen[k] then
				return true
			end
		end
		return false
	end,
}

string.lpad = function(str, len, char)
	if char == nil then char = ' ' end
	return string.rep(char, len - #(''..str)) .. str
end

return p