Minecraft Wiki:沙盒/header
.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
脚本错误:没有“Test”这个模块。
Column parameters
脚本错误:没有“Test”这个模块。
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
脚本错误:没有“Test”这个模块。
Example
{{#invoke:Test|base2|iron-ingot}} → Java版与基岩版:
{{#invoke:Test|base2|emerald}} → Java版:
| 物品 | 来源 | 物品数 | 堆叠数 | 几率 | 箱子数 |
|---|---|---|---|---|---|
| 绿宝石 | 末地城 | 0.36 | 2-6 | 9.03% | 11.1 |
| 沙漠神殿 | 0.36 | 1-3 | 18.05% | 5.5 | |
| 丛林神庙 | 0.17 | 1-3 | 8.74% | 11.4 | |
| 针叶林村庄房屋 | 0.46 | 1-4 | 18.58% | 5.4 | |
| 埋藏的宝藏 | 3.19 | 4-8 | 53.09% | 1.9 | |
| 大型海底废墟 | 0.15 | 1 | 14.94% | 6.7 | |
| 热带草原村庄房屋 | 0.54 | 1-4 | 21.46% | 4.7 | |
| 沉船宝箱 | 2.21 | 1-5 | 73.72% | 1.4 | |
| 平原村庄房屋 | 0.57 | 1-4 | 22.79% | 4.4 | |
| 雪域村庄房屋 | 0.25 | 1-4 | 9.9% | 10.1 | |
| 小型海底废墟 | 0.16 | 1 | 16.41% | 6.1 | |
| 雪屋 | 0.08 | 1 | 7.64% | 13.1 | |
| 村庄石匠小屋 | 0.21 | 1 | 20.84% | 4.8 | |
| 沙漠村庄房屋 | 0.28 | 1-3 | 14.25% | 7.0 | |
| 村庄牧羊人小屋 | 0.12 | 1 | 12.31% | 8.1 | |
| 村庄皮匠小屋 | 0.43 | 1-4 | 17.26% | 5.8 | |
| 村庄渔夫小屋 | 0.24 | 1 | 24.18% | 4.1 | |
| 村庄制箭师小屋 | 0.12 | 1 | 12.31% | 8.1 | |
| 村庄教堂 | 0.64 | 1-4 | 25.41% | 3.9 | |
| 村庄屠夫小屋 | 0.10 | 1 | 10.22% | 9.8 | |
| 村庄盔甲匠小屋 | 0.32 | 1 | 31.81% | 3.1 |
基岩版:
| 物品 | 来源 | 物品数 | 堆叠数 | 几率 | 箱子数 |
|---|---|---|---|---|---|
| 绿宝石 | 末地城 | 0.36 | 2-6 | 9.03% | 11.1 |
| 要塞走廊 | 0.14 | 1-3 | 7.1% | 14.1 | |
| 沙漠神殿 | 0.36 | 1-3 | 18.05% | 5.5 | |
| 丛林神庙 | 0.17 | 1-3 | 8.72% | 11.5 | |
| 针叶林村庄房屋 | 0.51 | 1-4 | 20.28% | 4.9 | |
| 热带草原村庄房屋 | 0.54 | 1-4 | 21.46% | 4.7 | |
| 大型海底废墟 | 0.15 | 1 | 14.94% | 6.7 | |
| 沉船宝箱 | 2.21 | 1-5 | 73.72% | 1.4 | |
| 雪域村庄房屋 | 0.25 | 1-4 | 9.9% | 10.1 | |
| 平原村庄房屋 | 0.57 | 1-4 | 22.79% | 4.4 | |
| 小型海底废墟 | 0.16 | 1 | 16.41% | 6.1 | |
| 沙漠村庄房屋 | 0.28 | 1-3 | 14.25% | 7.0 | |
| 雪屋 | 0.08 | 1 | 7.64% | 13.1 | |
| 村庄皮匠小屋 | 0.43 | 1-4 | 17.26% | 5.8 | |
| 村庄牧羊人小屋 | 0.12 | 1 | 12.31% | 8.1 | |
| 村庄石匠小屋 | 0.21 | 1 | 20.84% | 4.8 | |
| 村庄教堂 | 0.64 | 1-4 | 25.41% | 3.9 | |
| 村庄制箭师小屋 | 0.12 | 1 | 12.31% | 8.1 | |
| 村庄屠夫小屋 | 0.10 | 1 | 10.22% | 9.8 | |
| 村庄盔甲匠小屋 | 0.32 | 1 | 31.81% | 3.1 |
| 物品 | 来源 | 物品数 | 堆叠数 | 几率 | 箱子数 |
|---|---|---|---|---|---|
| 绿宝石 | 末地城 | 0.36 | 2-6 | 9.03% | 11.1 |
| 沙漠神殿 | 0.38 | 1-3 | 18.8% | 5.3 | |
| 丛林神庙 | 0.17 | 1-3 | 8.74% | 11.4 | |
| 针叶林村庄房屋 | 0.46 | 1-4 | 18.58% | 5.4 | |
| 埋藏的宝藏 | 3.19 | 4-8 | 53.09% | 1.9 | |
| 大型海底废墟 | 0.15 | 1 | 14.94% | 6.7 | |
| 沉船宝箱 | 2.21 | 1-5 | 73.72% | 1.4 | |
| 平原村庄房屋 | 0.57 | 1-4 | 22.79% | 4.4 | |
| 热带草原村庄房屋 | 0.54 | 1-4 | 21.46% | 4.7 | |
| 雪域村庄房屋 | 0.25 | 1-4 | 9.9% | 10.1 | |
| 小型海底废墟 | 0.16 | 1 | 16.41% | 6.1 | |
| 沙漠村庄房屋 | 0.28 | 1-3 | 14.25% | 7.0 | |
| 村庄石匠小屋 | 0.21 | 1 | 20.84% | 4.8 | |
| 雪屋 | 0.08 | 1 | 7.64% | 13.1 | |
| 村庄牧羊人小屋 | 0.12 | 1 | 12.31% | 8.1 | |
| 村庄皮匠小屋 | 0.43 | 1-4 | 17.26% | 5.8 | |
| 村庄渔夫小屋 | 0.24 | 1 | 24.18% | 4.1 | |
| 村庄教堂 | 0.64 | 1-4 | 25.41% | 3.9 | |
| 村庄制箭师小屋 | 0.12 | 1 | 12.31% | 8.1 | |
| 村庄屠夫小屋 | 0.10 | 1 | 10.22% | 9.8 | |
| 村庄盔甲匠小屋 | 0.32 | 1 | 31.81% | 3.1 |
| 物品 | 来源 | 物品数 | 堆叠数 | 几率 | 箱子数 |
|---|---|---|---|---|---|
| 绿宝石 | 末地城 | 0.36 | 2-6 | 9.03% | 11.1 |
| 要塞走廊 | 0.14 | 1-3 | 7.1% | 14.1 | |
| 沙漠神殿 | 0.38 | 1-3 | 18.8% | 5.3 | |
| 丛林神庙 | 0.17 | 1-3 | 8.72% | 11.5 | |
| 针叶林村庄房屋 | 0.51 | 1-4 | 20.28% | 4.9 | |
| 热带草原村庄房屋 | 0.54 | 1-4 | 21.46% | 4.7 | |
| 大型海底废墟 | 0.15 | 1 | 14.94% | 6.7 | |
| 沉船宝箱 | 2.21 | 1-5 | 73.72% | 1.4 | |
| 雪域村庄房屋 | 0.25 | 1-4 | 9.9% | 10.1 | |
| 平原村庄房屋 | 0.57 | 1-4 | 22.79% | 4.4 | |
| 小型海底废墟 | 0.16 | 1 | 16.41% | 6.1 | |
| 沙漠村庄房屋 | 0.28 | 1-3 | 14.25% | 7.0 | |
| 雪屋 | 0.08 | 1 | 7.64% | 13.1 | |
| 村庄皮匠小屋 | 0.43 | 1-4 | 17.26% | 5.8 | |
| 村庄牧羊人小屋 | 0.12 | 1 | 12.31% | 8.1 | |
| 村庄石匠小屋 | 0.21 | 1 | 20.84% | 4.8 | |
| 村庄教堂 | 0.64 | 1-4 | 25.41% | 3.9 | |
| 村庄制箭师小屋 | 0.12 | 1 | 12.31% | 8.1 | |
| 村庄屠夫小屋 | 0.10 | 1 | 10.22% | 9.8 | |
| 村庄盔甲匠小屋 | 0.32 | 1 | 31.81% | 3.1 |
Source
- The data is set up within
pso 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
idis included in the item definition.
- This key must match a sprite name for the items/blocks defined in Module:BlockSprite or Module:ItemSprite, unless
'<sprite-type>'- Either
itemorblock.
- Either
[, 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.
- Use this to specify a sprite defined in Module:BlockSprite or Module:ItemSprite. Otherwise it will use the sprite with the name given by
[, 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
falsewhen 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.
- Use
[, preserve_case=false]- Use
falsewhen an item name should follow the capitalization exactly specified intitle, and not follow sentence case, like 'TNT'.
- Use
[, 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].itemsp.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}}
脚本错误:没有“Test”这个模块。