Diferencia entre revisiones de «Módulo:LootChest»

De WikiMinecraft
Saltar a: navegación, buscar
 
Línea 24: Línea 24:
 
end,
 
end,
 
 
dev = 'En la {{1.9}},',
+
dev = 'En la {{1.9}}, ',
 
 
 
-- these define which sprite, label and link to use, in the table,
 
-- these define which sprite, label and link to use, in the table,

Revisión actual del 23:30 11 abr 2016

Esta es la página de documentación, debería ser transcluida a la página de plantilla principal. Véase Plantilla:Documentation para más información.

.base usage (Template:LootChest)

Genera una tabla de contenido de los cofres designados, con las columnas correspondientes a diversas estadísticas acerca de la disponibilidad de esos objetos.

Invocando

Toma cualquier número de parámetros de cofre, y cualquier número de parámetros de columna, sin ningún orden en particular.

Si no aparecen los parámetros de cofre, muestra todos ellos; del mismo modo para los parámetros de columna.

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

Parámetros de cofre

bonus,
desert-temple ( desert ),
dungeon,
end-city,
igloo,
jungle-temple ( jungle ),
mineshaft,
nether-fortress ( nether, fortress ),
stronghold-altar ( altar ),
stronghold-library ( library ),
stronghold-storeroom ( storeroom ),
village-blacksmith ( blacksmith, village )

Parámetros de columna

chance: las probabilidades de conseguir cualquiera de este material en un solo cofre.,
chests: el número de cofres esperados que buscar, para encontrar algo de este objeto.,
items: el número de objetos esperados por cada cofre, como promedio sobre un gran número de cofres.,
stacksize: el tamaño de las pilas (o por número de objetos no apilables) de este objeto que se encuentran en este cofre.,
weight: la cantidad de este objeto en relación con otros objetos en el cofre.

Ejemplo

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

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

.base2 usage (Template:LootChestItem)

Imprime un resumen de la disponibilidad de este objeto en los diversos cofres generados en el mundo.

Invocando

Toma exactamente un nombre de objeto como parámetro.

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

Parámetros de objeto

acacia-wood, acacia-wood-only, activator-rail, apple, beetroot-seeds, bone, book, bread, bucket, coal, compass, detector-rail, diamond, disc-13, disc-cat, emerald, empty, empty-map, enchanted-book, enchanted-book-rnd, enchanted-diamond-boots, enchanted-diamond-chestplate, enchanted-diamond-helmet, enchanted-diamond-leggings, enchanted-diamond-pickaxe, enchanted-diamond-shovel, enchanted-diamond-sword, enchanted-iron-boots, enchanted-iron-chestplate, enchanted-iron-helmet, enchanted-iron-leggings, enchanted-iron-pickaxe, enchanted-iron-shovel, enchanted-iron-sword, ender-pearl, flint-and-steel, gold-ingot, gold-nugget, golden-apple, golden-chestplate, golden-sword, gunpowder, horse-armor-diamond, horse-armor-gold, horse-armor-iron, iron-boots, iron-chestplate, iron-helmet, iron-ingot, iron-leggings, iron-pickaxe, iron-sword, lapis-lazuli, melon-seeds, name-tag, nether-wart, notch-apple, oak-sapling, oak-wood, oak-wood-only, obsidian, paper, powered-rail, pumpkin-seeds, rail, raw-salmon, redstone, rotten-flesh, saddle, sand, spider-eye, stick, stone-axe, stone-pickaxe, string, torch, wheat, wood-planks, wooden-axe, wooden-pickaxe

Ejemplo

{{#invoke:LootChest|base2|iron-ingot}} → Iron ingots se pueden encontrar en 54.0% de Mazmorra cofres en pilas de 1–4, y en 23.4% de Fortaleza cofres, 22.0% de Fortaleza del Inframundo cofres, 44.5% de Templo del desierto cofres, 46.1% de Aldea cofres, 45.2% de vagonetas con cofre en Minas abandonadas, 44.5% de Templo de la selva cofres, y 35.6% de Fortaleza cofres, todo en pilas de 1–5. En la 1.9, iron ingots se pueden encontrar en 18.8% de Mazmorra cofres en pilas de 1–4; en 23.4% de Fortaleza cofres, 19.2% de Fortaleza del Inframundo cofres, 18.2% de Templo del desierto cofres, 46.1% de Aldea cofres, 32.0% de vagonetas con cofre en Minas abandonadas, 44.5% de Templo de la selva cofres, y 35.6% de Fortaleza cofres, todo en pilas de 1–5; y en 39.4% de Ciudad del Fin cofres en pilas de 4–8.

{{#invoke:LootChest|base2|emerald}} → Emeralds se pueden encontrar en 10.5% de Templo del desierto cofres y 10.5% de Templo de la selva cofres en pilas de 1–3. En la 1.9, emeralds se pueden encontrar en 7.7% de Iglú cofres en pilas de 1, en 18.2% de Templo del desierto cofres y 10.5% de Templo de la selva cofres en pilas de 1–3, y en 9.1% de Ciudad del Fin cofres en pilas de 2–6.

Maintenimiento

The tables are current as of 1.8.8.

  • The source for 1.8.8 was the decompiled .jar. Anomie x (talk) 07:54, 29 October 2015 (UTC)

The tables are current as of snapshot 15w44a (should be checked/updated to 15w32b).

  • The source for 14w44a was the loot table from the .jar. Anomie x (talk) 07:54, 29 October 2015 (UTC)

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>' = { '<sprite-type>' [, id='<sprite-id>'] [, link='<item-link>'] [, title='<item-text>'] [, cannot_stack=false] [, plural=(false|'<custom-plural-word>')] [, note='<note-name>'] }
  • p.notes
'<note-name>' = '<note-full-text>'
  • p.chests[n].pools[n]
    • rolls
{ <min-number-of-stacks>, <max-number-of-stacks> }
  • p.chests[n].pools[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.

Keys

  • id: A different ID, from Template:ItemSprite or Template:BlockSprite.
  • link: A link to a page that is different from the sprite-id name.
  • title: A name for an item that is different from the sprite-id name.
  • note: Indicates that a note will appear next to this item in the table.
  • cannot_stack: used in LootChestItem. Use this to indicate that the item comes in groups rather than in stacks.
  • plural: used in LootChestItem. 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.

Valores

Funciones

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).

Casos testeados

Test de objetos

Acacia wood se pueden encontrar en 81.7% de bonus cofres en pilas de 1–3.

Apples se pueden encontrar en 33.7% de Fortaleza cofres, 61.6% de Aldea cofres, y 50.0% de Fortaleza cofres, todo en pilas de 1–3; y en 55.7% de bonus cofres en pilas de 2–3. En la 1.9, apples se pueden encontrar en 33.7% de Fortaleza cofres, 61.6% de Aldea cofres, 74.3% de Iglú cofres, y 50.0% de Fortaleza cofres, todo en pilas de 1–3; y en 83.8% de bonus cofres en pilas de 1–2.

Bones se pueden encontrar en 72.2% de Templo del desierto cofres y 72.2% de Templo de la selva cofres en pilas de 4–6. En la 1.9, bones se pueden encontrar en 29.0% de Templo del desierto cofres y 72.2% de Templo de la selva cofres en pilas de 4–6, y en 59.0% de Templo del desierto cofres y 57.8% de Mazmorra cofres en pilas de 1–8.

Books se pueden encontrar en 78.0% de Fortaleza cofres en pilas de 1–3. En la 1.9, books se pueden encontrar en 94.6% de Fortaleza cofres en pilas de 1–3.

Bread se pueden encontrar en 54.0% de Mazmorra cofres en pilas de 1; en 33.7% de Fortaleza cofres, 61.6% de Aldea cofres, 60.7% de vagonetas con cofre en Minas abandonadas, y 50.0% de Fortaleza cofres, todo en pilas de 1–3; y en 38.1% de bonus cofres en pilas de 2–3. En la 1.9, bread se pueden encontrar en 35.3% de Mazmorra cofres en pilas de 1; en 33.7% de Fortaleza cofres, 61.6% de Aldea cofres, 45.0% de vagonetas con cofre en Minas abandonadas, y 50.0% de Fortaleza cofres, todo en pilas de 1–3; y en 61.5% de bonus cofres en pilas de 1–2.

Buckets se pueden encontrar en 54.0% de Mazmorra cofres en pilas de 1. En la 1.9, buckets se pueden encontrar en 18.8% de Mazmorra cofres en pilas de 1.

Coal se pueden encontrar en 45.2% de vagonetas con cofre en Minas abandonadas y 35.6% de Fortaleza cofres en pilas de 3–8. En la 1.9, coal se pueden encontrar en 27.4% de Mazmorra cofres y 74.3% de Iglú cofres en pilas de 1–4, y en 32.0% de vagonetas con cofre en Minas abandonadas y 35.6% de Fortaleza cofres en pilas de 3–8.

Compasses se pueden encontrar en 5.6% de Fortaleza cofres en pilas de 1. En la 1.9, compasses se pueden encontrar en 11.0% de Fortaleza cofres en pilas de 1.

Diamond horse armor se pueden encontrar en 2.5% de Fortaleza cofres, 13.7% de Fortaleza del Inframundo cofres, 5.4% de Templo del desierto cofres, 5.7% de Aldea cofres, 7.2% de Mazmorra cofres, y 5.4% de Templo de la selva cofres, todo en grupos de 1. En la 1.9, diamond horse armor se pueden encontrar en 2.5% de Fortaleza cofres, 11.8% de Fortaleza del Inframundo cofres, 6.3% de Templo del desierto cofres, 5.7% de Aldea cofres, 7.7% de Mazmorra cofres, 4.6% de Ciudad del Fin cofres, y 5.4% de Templo de la selva cofres, todo en grupos de 1.

Diamonds se pueden encontrar en 7.4% de Fortaleza cofres, 22.0% de Fortaleza del Inframundo cofres, 15.5% de Templo del desierto cofres, 16.3% de Aldea cofres, y 15.5% de Templo de la selva cofres, todo en pilas de 1–3; y en 15.8% de vagonetas con cofre en Minas abandonadas en pilas de 1–2. En la 1.9, diamonds se pueden encontrar en 7.4% de Fortaleza cofres, 19.2% de Fortaleza del Inframundo cofres, 6.3% de Templo del desierto cofres, 16.3% de Aldea cofres, y 15.5% de Templo de la selva cofres, todo en pilas de 1–3; en 10.5% de vagonetas con cofre en Minas abandonadas en pilas de 1–2; y en 21.5% de Ciudad del Fin cofres en pilas de 2–7.

Emeralds se pueden encontrar en 10.5% de Templo del desierto cofres y 10.5% de Templo de la selva cofres en pilas de 1–3. En la 1.9, emeralds se pueden encontrar en 7.7% de Iglú cofres en pilas de 1, en 18.2% de Templo del desierto cofres y 10.5% de Templo de la selva cofres en pilas de 1–3, y en 9.1% de Ciudad del Fin cofres en pilas de 2–6.

Empty maps se pueden encontrar en 5.6% de Fortaleza cofres en pilas de 1. En la 1.9, empty maps se pueden encontrar en 11.0% de Fortaleza cofres en pilas de 1.

En la 1.9, acacia or dark oak wood se pueden encontrar en 68.4% de bonus cofres en pilas de 1–3.

En la 1.9, activator rails se pueden encontrar en 27.1% de vagonetas con cofre en Minas abandonadas en pilas de 1–4.

En la 1.9, beetroot seeds se pueden encontrar en 21.5% de Ciudad del Fin cofres en pilas de 1–10, y en 18.8% de Mazmorra cofres y 32.0% de vagonetas con cofre en Minas abandonadas en pilas de 2–4.

En la 1.9, detector rails se pueden encontrar en 27.1% de vagonetas con cofre en Minas abandonadas en pilas de 1–4.

En la 1.9, enchanted books se pueden encontrar en 23.7% de Templo del desierto cofres, 15.1% de Mazmorra cofres, y 14.1% de vagonetas con cofre en Minas abandonadas, todo en grupos de 1.

En la 1.9, enchanted diamond boots se pueden encontrar en 13.4% de Ciudad del Fin cofres en grupos de 1.

En la 1.9, enchanted diamond chestplates se pueden encontrar en 13.4% de Ciudad del Fin cofres en grupos de 1.

En la 1.9, enchanted diamond helmets se pueden encontrar en 13.4% de Ciudad del Fin cofres en grupos de 1.

En la 1.9, enchanted diamond leggings se pueden encontrar en 13.4% de Ciudad del Fin cofres en grupos de 1.

En la 1.9, enchanted diamond pickaxes se pueden encontrar en 13.4% de Ciudad del Fin cofres en grupos de 1.

En la 1.9, enchanted diamond shovels se pueden encontrar en 13.4% de Ciudad del Fin cofres en grupos de 1.

En la 1.9, enchanted diamond swords se pueden encontrar en 13.4% de Ciudad del Fin cofres en grupos de 1.

En la 1.9, enchanted iron boots se pueden encontrar en 13.4% de Ciudad del Fin cofres en grupos de 1.

En la 1.9, enchanted iron chestplates se pueden encontrar en 13.4% de Ciudad del Fin cofres en grupos de 1.

En la 1.9, enchanted iron helmets se pueden encontrar en 13.4% de Ciudad del Fin cofres en grupos de 1.

En la 1.9, enchanted iron leggings se pueden encontrar en 13.4% de Ciudad del Fin cofres en grupos de 1.

En la 1.9, enchanted iron pickaxes se pueden encontrar en 13.4% de Ciudad del Fin cofres en grupos de 1.

En la 1.9, enchanted iron shovels se pueden encontrar en 13.4% de Ciudad del Fin cofres en grupos de 1.

En la 1.9, enchanted iron swords se pueden encontrar en 13.4% de Ciudad del Fin cofres en grupos de 1.

En la 1.9, gold nuggets se pueden encontrar en 57.9% de Iglú cofres en pilas de 1–3.

En la 1.9, golden apples (enchanted) se pueden encontrar en 2.6% de Templo del desierto cofres, 3.1% de Mazmorra cofres, y 1.4% de vagonetas con cofre en Minas abandonadas, todo en pilas de 1.

En la 1.9, nothing se pueden encontrar en 18.2% de Templo del desierto cofres y 7.0% de vagonetas con cofre en Minas abandonadas en pilas de 1.

En la 1.9, oak, spruce, birch or jungle wood se pueden encontrar en 68.4% de bonus cofres en pilas de 1–3.

En la 1.9, powered rails se pueden encontrar en 27.1% de vagonetas con cofre en Minas abandonadas en pilas de 1–4.

En la 1.9, raw salmon se pueden encontrar en 61.5% de bonus cofres en pilas de 1–2.

En la 1.9, sand se pueden encontrar en 59.0% de Templo del desierto cofres en pilas de 1–8.

En la 1.9, spider eyes se pueden encontrar en 29.0% de Templo del desierto cofres en pilas de 1–3.

En la 1.9, torches se pueden encontrar en 65.7% de vagonetas con cofre en Minas abandonadas en pilas de 1–16.

Enchanted books se pueden encontrar en 2.5% de Fortaleza cofres, 5.4% de Templo del desierto cofres, 7.2% de Mazmorra cofres, 5.5% de vagonetas con cofre en Minas abandonadas, 5.4% de Templo de la selva cofres, y 4.0% de Fortaleza cofres, todo en grupos de 1; y en 11.0% de Fortaleza cofres en grupos de 1–5. En la 1.9, enchanted books se pueden encontrar en 2.5% de Fortaleza cofres, 72.2% de Fortaleza cofres, 5.4% de Templo de la selva cofres, y 4.0% de Fortaleza cofres, todo en grupos de 1.

Ender pearls se pueden encontrar en 23.4% de Fortaleza cofres en pilas de 1. En la 1.9, ender pearls se pueden encontrar en 23.4% de Fortaleza cofres en pilas de 1.

Flint and steel se pueden encontrar en 22.0% de Fortaleza del Inframundo cofres en grupos de 1. En la 1.9, flint and steel se pueden encontrar en 19.2% de Fortaleza del Inframundo cofres en grupos de 1.

Gold horse armor se pueden encontrar en 2.5% de Fortaleza cofres, 33.4% de Fortaleza del Inframundo cofres, 5.4% de Templo del desierto cofres, 5.7% de Aldea cofres, 13.9% de Mazmorra cofres, y 5.4% de Templo de la selva cofres, todo en grupos de 1. En la 1.9, gold horse armor se pueden encontrar en 2.5% de Fortaleza cofres, 29.4% de Fortaleza del Inframundo cofres, 12.4% de Templo del desierto cofres, 5.7% de Aldea cofres, 15.1% de Mazmorra cofres, 4.6% de Ciudad del Fin cofres, y 5.4% de Templo de la selva cofres, todo en grupos de 1.

Gold ingots se pueden encontrar en 12.2% de Fortaleza cofres, 55.3% de Fortaleza del Inframundo cofres, 26.0% de Aldea cofres, 25.2% de vagonetas con cofre en Minas abandonadas, y 19.0% de Fortaleza cofres, todo en pilas de 1–3; y en 60.2% de Templo del desierto cofres y 60.2% de Templo de la selva cofres en pilas de 2–7. En la 1.9, gold ingots se pueden encontrar en 12.2% de Fortaleza cofres, 49.8% de Fortaleza del Inframundo cofres, 26.0% de Aldea cofres, 17.0% de vagonetas con cofre en Minas abandonadas, y 19.0% de Fortaleza cofres, todo en pilas de 1–3; en 18.2% de Templo del desierto cofres, 54.0% de Ciudad del Fin cofres, y 60.2% de Templo de la selva cofres, todo en pilas de 2–7; y en 9.7% de Mazmorra cofres en pilas de 1–4.

Golden apples (normal) se pueden encontrar en 2.5% de Fortaleza cofres y 7.2% de Mazmorra cofres en pilas de 1. En la 1.9, golden apples (normal) se pueden encontrar en 2.5% de Fortaleza cofres, 23.7% de Templo del desierto cofres, 22.2% de Mazmorra cofres, 28.2% de vagonetas con cofre en Minas abandonadas, y 100.0% de Iglú cofres, todo en pilas de 1.

Golden chestplates se pueden encontrar en 22.0% de Fortaleza del Inframundo cofres en grupos de 1. En la 1.9, golden chestplates se pueden encontrar en 19.2% de Fortaleza del Inframundo cofres en grupos de 1.

Golden swords se pueden encontrar en 22.0% de Fortaleza del Inframundo cofres en grupos de 1. En la 1.9, golden swords se pueden encontrar en 19.2% de Fortaleza del Inframundo cofres en grupos de 1.

Gunpowder se pueden encontrar en 54.0% de Mazmorra cofres en pilas de 1–4. En la 1.9, gunpowder se pueden encontrar en 59.0% de Templo del desierto cofres y 57.8% de Mazmorra cofres en pilas de 1–8.

Iron boots se pueden encontrar en 12.2% de Fortaleza cofres y 26.0% de Aldea cofres en grupos de 1. En la 1.9, iron boots se pueden encontrar en 12.2% de Fortaleza cofres y 26.0% de Aldea cofres en grupos de 1.

Iron chestplates se pueden encontrar en 12.2% de Fortaleza cofres y 26.0% de Aldea cofres en grupos de 1. En la 1.9, iron chestplates se pueden encontrar en 12.2% de Fortaleza cofres y 26.0% de Aldea cofres en grupos de 1.

Iron helmets se pueden encontrar en 12.2% de Fortaleza cofres y 26.0% de Aldea cofres en grupos de 1. En la 1.9, iron helmets se pueden encontrar en 12.2% de Fortaleza cofres y 26.0% de Aldea cofres en grupos de 1.

Iron horse armor se pueden encontrar en 2.5% de Fortaleza cofres, 22.0% de Fortaleza del Inframundo cofres, 5.4% de Templo del desierto cofres, 5.7% de Aldea cofres, 31.6% de Mazmorra cofres, 5.5% de vagonetas con cofre en Minas abandonadas, y 5.4% de Templo de la selva cofres, todo en grupos de 1. En la 1.9, iron horse armor se pueden encontrar en 2.5% de Fortaleza cofres, 19.2% de Fortaleza del Inframundo cofres, 18.2% de Templo del desierto cofres, 5.7% de Aldea cofres, 22.2% de Mazmorra cofres, 4.6% de Ciudad del Fin cofres, y 5.4% de Templo de la selva cofres, todo en grupos de 1.

Iron ingots se pueden encontrar en 54.0% de Mazmorra cofres en pilas de 1–4, y en 23.4% de Fortaleza cofres, 22.0% de Fortaleza del Inframundo cofres, 44.5% de Templo del desierto cofres, 46.1% de Aldea cofres, 45.2% de vagonetas con cofre en Minas abandonadas, 44.5% de Templo de la selva cofres, y 35.6% de Fortaleza cofres, todo en pilas de 1–5. En la 1.9, iron ingots se pueden encontrar en 18.8% de Mazmorra cofres en pilas de 1–4; en 23.4% de Fortaleza cofres, 19.2% de Fortaleza del Inframundo cofres, 18.2% de Templo del desierto cofres, 46.1% de Aldea cofres, 32.0% de vagonetas con cofre en Minas abandonadas, 44.5% de Templo de la selva cofres, y 35.6% de Fortaleza cofres, todo en pilas de 1–5; y en 39.4% de Ciudad del Fin cofres en pilas de 4–8.

Iron leggings se pueden encontrar en 12.2% de Fortaleza cofres y 26.0% de Aldea cofres en grupos de 1. En la 1.9, iron leggings se pueden encontrar en 12.2% de Fortaleza cofres y 26.0% de Aldea cofres en grupos de 1.

Iron pickaxes se pueden encontrar en 12.2% de Fortaleza cofres, 26.0% de Aldea cofres, 5.5% de vagonetas con cofre en Minas abandonadas, y 4.0% de Fortaleza cofres, todo en grupos de 1. En la 1.9, iron pickaxes se pueden encontrar en 12.2% de Fortaleza cofres, 26.0% de Aldea cofres, 7.0% de vagonetas con cofre en Minas abandonadas, y 4.0% de Fortaleza cofres, todo en grupos de 1.

Iron swords se pueden encontrar en 12.2% de Fortaleza cofres y 26.0% de Aldea cofres en grupos de 1. En la 1.9, iron swords se pueden encontrar en 12.2% de Fortaleza cofres y 26.0% de Aldea cofres en grupos de 1.

Lapis lazuli se pueden encontrar en 25.2% de vagonetas con cofre en Minas abandonadas en pilas de 4–9. En la 1.9, lapis lazuli se pueden encontrar en 17.0% de vagonetas con cofre en Minas abandonadas en pilas de 4–9.

Melon seeds se pueden encontrar en 45.2% de vagonetas con cofre en Minas abandonadas en pilas de 2–4. En la 1.9, melon seeds se pueden encontrar en 18.8% de Mazmorra cofres y 32.0% de vagonetas con cofre en Minas abandonadas en pilas de 2–4.

Music disc (13) se pueden encontrar en 26.1% de Mazmorra cofres en grupos de 1. En la 1.9, music disc (13) se pueden encontrar en 22.2% de Mazmorra cofres en grupos de 1.

Music disc (cat) se pueden encontrar en 26.1% de Mazmorra cofres en grupos de 1. En la 1.9, music disc (cat) se pueden encontrar en 22.2% de Mazmorra cofres en grupos de 1.

Name tags se pueden encontrar en 54.0% de Mazmorra cofres en pilas de 1. En la 1.9, name tags se pueden encontrar en 29.0% de Mazmorra cofres y 42.3% de vagonetas con cofre en Minas abandonadas en pilas de 1.

Nether wart se pueden encontrar en 22.0% de Fortaleza del Inframundo cofres en pilas de 3–7. En la 1.9, nether wart se pueden encontrar en 19.2% de Fortaleza del Inframundo cofres en pilas de 3–7.

Oak saplings se pueden encontrar en 26.0% de Aldea cofres en pilas de 3–7. En la 1.9, oak saplings se pueden encontrar en 26.0% de Aldea cofres en pilas de 3–7.

Oak wood planks se pueden encontrar en 81.7% de bonus cofres en pilas de 1–3. En la 1.9, oak wood planks se pueden encontrar en 68.4% de bonus cofres en pilas de 1–12.

Oak wood se pueden encontrar en 81.7% de bonus cofres en pilas de 1–3.

Obsidian se pueden encontrar en 26.0% de Aldea cofres en pilas de 3–7, y en 9.3% de Fortaleza del Inframundo cofres en pilas de 2–4. En la 1.9, obsidian se pueden encontrar en 26.0% de Aldea cofres en pilas de 3–7, y en 8.0% de Fortaleza del Inframundo cofres en pilas de 2–4.

Paper se pueden encontrar en 78.0% de Fortaleza cofres en pilas de 2–7. En la 1.9, paper se pueden encontrar en 94.6% de Fortaleza cofres en pilas de 2–7.

Pumpkin seeds se pueden encontrar en 45.2% de vagonetas con cofre en Minas abandonadas en pilas de 2–4. En la 1.9, pumpkin seeds se pueden encontrar en 18.8% de Mazmorra cofres y 32.0% de vagonetas con cofre en Minas abandonadas en pilas de 2–4.

Rails se pueden encontrar en 5.5% de vagonetas con cofre en Minas abandonadas en pilas de 4–8. En la 1.9, rails se pueden encontrar en 78.4% de vagonetas con cofre en Minas abandonadas en pilas de 4–8.

Redstone se pueden encontrar en 54.0% de Mazmorra cofres en pilas de 1–4, y en 12.2% de Fortaleza cofres, 25.2% de vagonetas con cofre en Minas abandonadas, y 19.0% de Fortaleza cofres, todo en pilas de 4–9. En la 1.9, redstone se pueden encontrar en 27.4% de Mazmorra cofres en pilas de 1–4, y en 12.2% de Fortaleza cofres, 17.0% de vagonetas con cofre en Minas abandonadas, y 19.0% de Fortaleza cofres, todo en pilas de 4–9.

Rotten flesh se pueden encontrar en 62.8% de Templo del desierto cofres y 62.8% de Templo de la selva cofres en pilas de 3–7. En la 1.9, rotten flesh se pueden encontrar en 57.9% de Iglú cofres en pilas de 1, en 29.0% de Templo del desierto cofres y 62.8% de Templo de la selva cofres en pilas de 3–7, y en 59.0% de Templo del desierto cofres y 57.8% de Mazmorra cofres en pilas de 1–8.

Saddles se pueden encontrar en 2.5% de Fortaleza cofres, 40.3% de Fortaleza del Inframundo cofres, 15.5% de Templo del desierto cofres, 16.3% de Aldea cofres, 54.0% de Mazmorra cofres, 15.8% de vagonetas con cofre en Minas abandonadas, y 15.5% de Templo de la selva cofres, todo en grupos de 1. En la 1.9, saddles se pueden encontrar en 2.5% de Fortaleza cofres, 35.7% de Fortaleza del Inframundo cofres, 23.7% de Templo del desierto cofres, 16.3% de Aldea cofres, 29.0% de Mazmorra cofres, 13.4% de Ciudad del Fin cofres, y 15.5% de Templo de la selva cofres, todo en grupos de 1.

Sticks se pueden encontrar en 81.7% de bonus cofres en pilas de 1–3. En la 1.9, sticks se pueden encontrar en 68.4% de bonus cofres en pilas de 1–12.

Stone axes se pueden encontrar en 38.1% de bonus cofres en grupos de 1. En la 1.9, stone axes se pueden encontrar en 14.9% de Iglú cofres y 25.0% de bonus cofres en grupos de 1.

Stone pickaxes se pueden encontrar en 38.1% de bonus cofres en grupos de 1. En la 1.9, stone pickaxes se pueden encontrar en 25.0% de bonus cofres en grupos de 1.

String se pueden encontrar en 54.0% de Mazmorra cofres en pilas de 1–4. En la 1.9, string se pueden encontrar en 59.0% de Templo del desierto cofres y 57.8% de Mazmorra cofres en pilas de 1–8.

Wheat se pueden encontrar en 54.0% de Mazmorra cofres en pilas de 1–4. En la 1.9, wheat se pueden encontrar en 35.3% de Mazmorra cofres en pilas de 1–4, y en 57.9% de Iglú cofres en pilas de 2–3.

Wooden axes se pueden encontrar en 55.7% de bonus cofres en grupos de 1. En la 1.9, wooden axes se pueden encontrar en 75.0% de bonus cofres en grupos de 1.

Wooden pickaxes se pueden encontrar en 55.7% de bonus cofres en grupos de 1. En la 1.9, wooden pickaxes se pueden encontrar en 75.0% de bonus cofres en grupos de 1.


Test de cofres

{{LootChest}}

Bonus
(1, 1, 3, and 4 stacks)
Templo del
desierto
(2–4 and 4 stacks)
Mazmorra
(1–3, 1–4, and 3 stacks)
Ciudad
del Fin
(2–6 stacks)
Iglú
(2–8 and 1 stacks)
Templo de
la selva
(2–6 stacks)
Mina
(1, 2–4, and 3 stacks)
Fortaleza del
Inframundo
(2–4 stacks)
Fortaleza Aldea
(3–8 stacks)
Altar
(2–3 stacks)
Biblioteca
(2–10 stacks)
Despensa
(1–4 stacks)
Stack Size Weight # Items Chance # Chests Stack Size Weight # Items Chance # Chests Stack Size Weight # Items Chance # Chests Stack Size Weight # Items Chance # Chests Stack Size Weight # Items Chance # Chests Stack Size Weight # Items Chance # Chests Stack Size Weight # Items Chance # Chests Stack Size Weight # Items Chance # Chests Stack Size Weight # Items Chance # Chests Stack Size Weight # Items Chance # Chests Stack Size Weight # Items Chance # Chests Stack Size Weight # Items Chance # Chests
2–4× 2–4× 1–3× 1–4× 1–3× 1–4× 2–8× 2–8× 2–4× 2–4×

Apple
1–25112.04583.8%1.2 1–315632.38174.3%1.3 1–315990.75833.7%3.0 1–315621.21050.0%2.0 1–315941.75561.6%1.6

Wooden Axe
1340.75075.0%1.3

Wooden Pickaxe
1340.75075.0%1.3

Stick
1–1210406.50068.4%1.5

Oak Wood Planks
1–1210406.50068.4%1.5

Acacia or Dark Oak Wood
1–310402.00068.4%1.5

Oak, Spruce, Birch or Jungle Wood
1–310402.00068.4%1.5

Bread
1–23111.22761.5%1.6 1201250.40035.3%2.8 1–315831.08445.0%2.2 1–315990.75833.7%3.0 1–315621.21050.0%2.0 1–315941.75561.6%1.6

Raw Salmon
1–23111.22761.5%1.6

Stone Axe
1140.25025.0%4.0 12630.15914.9%6.7

Stone Pickaxe
1140.25025.0%4.0

Paper
2–7205210.38594.6%1.1

Book
1–320524.61594.6%1.1

Rails
4–820507.20078.4%1.3

Bone
4–61–82523210505.21670.9%1.4 1–810403.37557.8%1.7 4–620735.47972.2%1.4

Rotten Flesh
3–71–82523210505.21670.9%1.4 1–810403.37557.8%1.7 110630.79457.9%1.7 3–716734.38462.8%1.6

Torch
1–1615507.65065.7%1.5

Gunpowder
1–810503.60059.0%1.7 1–810403.37557.8%1.7

Sand
1–810503.60059.0%1.7

String
1–810503.60059.0%1.7 1–810403.37557.8%1.7

Gold Nugget
1–310631.58757.9%1.7

Wheat
1–4201251.00035.3%2.8 2–310631.98457.9%1.7

Name Tag
1201270.31529.0%3.4 130710.42342.3%2.4

Spider Eye
1–3252320.64729.0%3.5

Coal
1–4151250.75027.4%3.7 1–415632.97674.3%1.3 3–810831.98832.0%3.1 3–810622.21835.6%2.8

Redstone
1–4151250.75027.4%3.7 4–95831.17517.0%5.9 4–95990.82112.2%8.2 4–95621.31019.0%5.3

Activator Rails
1–45500.75027.1%3.7

Detector Rails
1–45500.75027.1%3.7

Powered Rails
1–45500.75027.1%3.7

Oak Sapling
3–75941.46326.0%3.9

Enchanted Book[note 1]
1202320.25923.7%4.2 1101270.15715.1%6.6 110710.14114.1%7.1

Saddle
1202320.25923.7%4.2 1201270.31529.0%3.4 13850.14113.4%7.5 13730.16415.5%6.5 110730.41135.7%2.8 11990.0252.5%39.9 13940.17616.3%6.1

Golden Apple (Normal)
1202320.25923.7%4.2 1151270.23622.2%4.5 1111.000100.0%1.0 120710.28228.2%3.5 11990.0252.5%39.9

Ender Pearl
110990.25323.4%4.3

Music Disc (13)
1151270.23622.2%4.5

Music Disc (Cat)
1151270.23622.2%4.5

Nether Wart
3–75731.02719.2%5.2

Flint and Steel
15730.20519.2%5.2

Golden Sword
15730.20519.2%5.2

Golden Chestplate
15730.20519.2%5.2

Beetroot Seeds
2–4101250.60018.8%5.3 1–105851.29421.5%4.6 2–410831.08432.0%3.1

Melon Seeds
2–4101250.60018.8%5.3 2–410831.08432.0%3.1

Pumpkin Seeds
2–4101250.60018.8%5.3 2–410831.08432.0%3.1

Bucket
1101250.20018.8%5.3

Gold Ingot
2–7152320.87318.2%5.5 1–451250.2509.7%10.3 2–715853.17654.0%1.9 2–715733.69960.2%1.7 1–35830.36117.0%5.9 1–315731.23349.8%2.0 1–35990.25312.2%8.2 1–35620.40319.0%5.3 1–35940.58526.0%3.9

Iron Ingot
1–5152320.58218.2%5.5 1–4101250.50018.8%5.3 4–810852.82439.4%2.5 1–510731.64444.5%2.2 1–510831.08432.0%3.1 1–55730.61619.2%5.2 1–510990.75823.4%4.3 1–510621.21035.6%2.8 1–510941.75546.1%2.2

Emerald
1–3152320.38818.2%5.5 2–62850.3769.1%11.0 11630.0797.7%13.0 1–32730.21910.5%9.5

Nothing
1152320.19418.2%5.5 15710.0707.0%14.2

Iron Horse Armor
1152320.19418.2%5.5 1151270.23622.2%4.5 11850.0474.6%21.6 11730.0555.4%18.6 15730.20519.2%5.2 11990.0252.5%39.9 11940.0595.7%17.5

Lapis Lazuli
4–95831.17517.0%5.9

Enchanted Iron Pickaxe[note 2]
13850.14113.4%7.5

Enchanted Iron Shovel[note 2]
13850.14113.4%7.5

Enchanted Iron Sword[note 2]
13850.14113.4%7.5

Enchanted Iron Helmet[note 2]
13850.14113.4%7.5

Enchanted Iron Chestplate[note 2]
13850.14113.4%7.5

Enchanted Iron Leggings[note 2]
13850.14113.4%7.5

Enchanted Iron Boots[note 2]
13850.14113.4%7.5

Enchanted Diamond Pickaxe[note 2]
13850.14113.4%7.5

Enchanted Diamond Shovel[note 2]
13850.14113.4%7.5

Enchanted Diamond Sword[note 2]
13850.14113.4%7.5

Enchanted Diamond Helmet[note 2]
13850.14113.4%7.5

Enchanted Diamond Chestplate[note 2]
13850.14113.4%7.5

Enchanted Diamond Leggings[note 2]
13850.14113.4%7.5

Enchanted Diamond Boots[note 2]
13850.14113.4%7.5

Gold Horse Armor
1102320.12912.4%8.1 1101270.15715.1%6.6 11850.0474.6%21.6 11730.0555.4%18.6 18730.32929.4%3.4 11990.0252.5%39.9 11940.0595.7%17.5

Iron Sword
15990.12612.2%8.2 15940.29326.0%3.9

Iron Helmet
15990.12612.2%8.2 15940.29326.0%3.9

Iron Chestplate
15990.12612.2%8.2 15940.29326.0%3.9

Iron Leggings
15990.12612.2%8.2 15940.29326.0%3.9

Iron Boots
15990.12612.2%8.2 15940.29326.0%3.9

Compass
11520.11511.0%9.1

Empty Map
11520.11511.0%9.1

Obsidian
2–42730.2478.0%12.5 3–75941.46326.0%3.9

Iron Pickaxe
15710.0707.0%14.2 15990.12612.2%8.2 11620.0404.0%25.1 15940.29326.0%3.9

Diamond
1–352320.1296.3%15.8 2–75851.05921.5%4.6 1–33730.32915.5%6.5 1–23830.16310.5%9.6 1–35730.41119.2%5.2 1–33990.1527.4%13.5 1–33940.35116.3%6.1

Diamond Horse Armor
152320.0656.3%15.8 151270.0797.7%13.0 11850.0474.6%21.6 11730.0555.4%18.6 13730.12311.8%8.5 11990.0252.5%39.9 11940.0595.7%17.5

Enchanted Book[note 3]
11730.0555.4%18.6 11990.0252.5%39.9 110521.15472.2%1.4 11620.0404.0%25.1

Golden Apple (Enchanted)
122320.0262.6%39.0 121270.0313.1%32.0 11710.0141.4%71.0

{{LootChest|chance}}

Los valores representan las probabilidades de conseguir cualquiera de este material en un solo cofre.

Bonus
(1, 1, 3, and 4 stacks)
Templo del
desierto
(2–4 and 4 stacks)
Mazmorra
(1–3, 1–4, and 3 stacks)
Ciudad
del Fin
(2–6 stacks)
Iglú
(2–8 and 1 stacks)
Templo de
la selva
(2–6 stacks)
Mina
(1, 2–4, and 3 stacks)
Fortaleza del
Inframundo
(2–4 stacks)
Fortaleza Aldea
(3–8 stacks)
Altar
(2–3 stacks)
Biblioteca
(2–10 stacks)
Despensa
(1–4 stacks)

Apple
83.8% 74.3% 33.7% 50.0% 61.6%

Wooden Axe
75.0%

Wooden Pickaxe
75.0%

Stick
68.4%

Oak Wood Planks
68.4%

Acacia or Dark Oak Wood
68.4%

Oak, Spruce, Birch or Jungle Wood
68.4%

Bread
61.5% 35.3% 45.0% 33.7% 50.0% 61.6%

Raw Salmon
61.5%

Stone Axe
25.0% 14.9%

Stone Pickaxe
25.0%

Paper
94.6%

Book
94.6%

Rails
78.4%

Bone
70.9% 57.8% 72.2%

Rotten Flesh
70.9% 57.8% 57.9% 62.8%

Torch
65.7%

Gunpowder
59.0% 57.8%

Sand
59.0%

String
59.0% 57.8%

Gold Nugget
57.9%

Wheat
35.3% 57.9%

Name Tag
29.0% 42.3%

Spider Eye
29.0%

Coal
27.4% 74.3% 32.0% 35.6%

Redstone
27.4% 17.0% 12.2% 19.0%

Activator Rails
27.1%

Detector Rails
27.1%

Powered Rails
27.1%

Oak Sapling
26.0%

Enchanted Book[note 1]
23.7% 15.1% 14.1%

Saddle
23.7% 29.0% 13.4% 15.5% 35.7% 2.5% 16.3%

Golden Apple (Normal)
23.7% 22.2% 100.0% 28.2% 2.5%

Ender Pearl
23.4%

Music Disc (13)
22.2%

Music Disc (Cat)
22.2%

Nether Wart
19.2%

Flint and Steel
19.2%

Golden Sword
19.2%

Golden Chestplate
19.2%

Beetroot Seeds
18.8% 21.5% 32.0%

Melon Seeds
18.8% 32.0%

Pumpkin Seeds
18.8% 32.0%

Bucket
18.8%

Gold Ingot
18.2% 9.7% 54.0% 60.2% 17.0% 49.8% 12.2% 19.0% 26.0%

Iron Ingot
18.2% 18.8% 39.4% 44.5% 32.0% 19.2% 23.4% 35.6% 46.1%

Emerald
18.2% 9.1% 7.7% 10.5%

Nothing
18.2% 7.0%

Iron Horse Armor
18.2% 22.2% 4.6% 5.4% 19.2% 2.5% 5.7%

Lapis Lazuli
17.0%

Enchanted Iron Pickaxe[note 2]
13.4%

Enchanted Iron Shovel[note 2]
13.4%

Enchanted Iron Sword[note 2]
13.4%

Enchanted Iron Helmet[note 2]
13.4%

Enchanted Iron Chestplate[note 2]
13.4%

Enchanted Iron Leggings[note 2]
13.4%

Enchanted Iron Boots[note 2]
13.4%

Enchanted Diamond Pickaxe[note 2]
13.4%

Enchanted Diamond Shovel[note 2]
13.4%

Enchanted Diamond Sword[note 2]
13.4%

Enchanted Diamond Helmet[note 2]
13.4%

Enchanted Diamond Chestplate[note 2]
13.4%

Enchanted Diamond Leggings[note 2]
13.4%

Enchanted Diamond Boots[note 2]
13.4%

Gold Horse Armor
12.4% 15.1% 4.6% 5.4% 29.4% 2.5% 5.7%

Iron Sword
12.2% 26.0%

Iron Helmet
12.2% 26.0%

Iron Chestplate
12.2% 26.0%

Iron Leggings
12.2% 26.0%

Iron Boots
12.2% 26.0%

Compass
11.0%

Empty Map
11.0%

Obsidian
8.0% 26.0%

Iron Pickaxe
7.0% 12.2% 4.0% 26.0%

Diamond
6.3% 21.5% 15.5% 10.5% 19.2% 7.4% 16.3%

Diamond Horse Armor
6.3% 7.7% 4.6% 5.4% 11.8% 2.5% 5.7%

Enchanted Book[note 3]
5.4% 2.5% 72.2% 4.0%

Golden Apple (Enchanted)
2.6% 3.1% 1.4%

{{LootChest|stronghold-altar|stronghold-library|stronghold-storeroom}}

Fortaleza
Altar
(2–3 stacks)
Biblioteca
(2–10 stacks)
Despensa
(1–4 stacks)
Stack Size Weight # Items Chance # Chests Stack Size Weight # Items Chance # Chests Stack Size Weight # Items Chance # Chests

Apple
1–315990.75833.7%3.0 1–315621.21050.0%2.0

Bread
1–315990.75833.7%3.0 1–315621.21050.0%2.0

Iron Ingot
1–510990.75823.4%4.3 1–510621.21035.6%2.8

Ender Pearl
110990.25323.4%4.3

Redstone
4–95990.82112.2%8.2 4–95621.31019.0%5.3

Gold Ingot
1–35990.25312.2%8.2 1–35620.40319.0%5.3

Iron Pickaxe
15990.12612.2%8.2 11620.0404.0%25.1

Iron Sword
15990.12612.2%8.2

Iron Helmet
15990.12612.2%8.2

Iron Chestplate
15990.12612.2%8.2

Iron Leggings
15990.12612.2%8.2

Iron Boots
15990.12612.2%8.2

Diamond
1–33990.1527.4%13.5

Enchanted Book[note 3]
11990.0252.5%39.9 110521.15472.2%1.4 11620.0404.0%25.1

Saddle
11990.0252.5%39.9

Iron Horse Armor
11990.0252.5%39.9

Golden Apple (Normal)
11990.0252.5%39.9

Gold Horse Armor
11990.0252.5%39.9

Diamond Horse Armor
11990.0252.5%39.9

Paper
2–7205210.38594.6%1.1

Book
1–320524.61594.6%1.1

Coal
3–810622.21835.6%2.8

Compass
11520.11511.0%9.1

Empty Map
11520.11511.0%9.1

{{LootChest|altar|library|storeroom|stacksize|chance}}

Fortaleza
Altar
(2–3 stacks)
Biblioteca
(2–10 stacks)
Despensa
(1–4 stacks)
Stack Size Chance Stack Size Chance Stack Size Chance

Apple
1–333.7% 1–350.0%

Bread
1–333.7% 1–350.0%

Iron Ingot
1–523.4% 1–535.6%

Ender Pearl
123.4%

Redstone
4–912.2% 4–919.0%

Gold Ingot
1–312.2% 1–319.0%

Iron Pickaxe
112.2% 14.0%

Iron Sword
112.2%

Iron Helmet
112.2%

Iron Chestplate
112.2%

Iron Leggings
112.2%

Iron Boots
112.2%

Diamond
1–37.4%

Enchanted Book[note 3]
12.5% 172.2% 14.0%

Saddle
12.5%

Iron Horse Armor
12.5%

Golden Apple (Normal)
12.5%

Gold Horse Armor
12.5%

Diamond Horse Armor
12.5%

Paper
2–794.6%

Book
1–394.6%

Coal
3–835.6%

Compass
111.0%

Empty Map
111.0%

{{LootChest|bonus}}

Cada bonus cofre contiene 4 grupos de 1, 1, 3, y 4 pilas de objetos, con la siguiente distribución:

Stack Size Weight # Items Chance # Chests

Apple
1–25112.04583.8%1.2

Wooden Axe
1340.75075.0%1.3

Wooden Pickaxe
1340.75075.0%1.3

Stick
1–1210406.50068.4%1.5

Oak Wood Planks
1–1210406.50068.4%1.5

Acacia or Dark Oak Wood
1–310402.00068.4%1.5

Oak, Spruce, Birch or Jungle Wood
1–310402.00068.4%1.5

Bread
1–23111.22761.5%1.6

Raw Salmon
1–23111.22761.5%1.6

Stone Axe
1140.25025.0%4.0

Stone Pickaxe
1140.25025.0%4.0

{{LootChest|desert}}

Cada templo del desierto cofre contiene 2–6 pilas de objetos, con la siguiente distribución:

Stack Size Weight # Items Chance # Chests

Bone
4–620735.47972.2%1.4

Rotten Flesh
3–716734.38462.8%1.6

Gold Ingot
2–715733.69960.2%1.7

Iron Ingot
1–510731.64444.5%2.2

Diamond
1–33730.32915.5%6.5

Saddle
13730.16415.5%6.5

Emerald
1–32730.21910.5%9.5

Enchanted Book[note 3]
11730.0555.4%18.6

Iron Horse Armor
11730.0555.4%18.6

Gold Horse Armor
11730.0555.4%18.6

Diamond Horse Armor
11730.0555.4%18.6

En la 1.9, cada templo del desierto cofre contiene 2 grupos de 2–4 y 4 pilas de objetos, con la siguiente distribución:

Stack Size Weight # Items Chance # Chests
2–4× 2–4×

Bone
4–61–82523210505.21670.9%1.4

Rotten Flesh
3–71–82523210505.21670.9%1.4

Gunpowder
1–810503.60059.0%1.7

Sand
1–810503.60059.0%1.7

String
1–810503.60059.0%1.7

Spider Eye
1–3252320.64729.0%3.5

Enchanted Book[note 1]
1202320.25923.7%4.2

Saddle
1202320.25923.7%4.2

Golden Apple (Normal)
1202320.25923.7%4.2

Gold Ingot
2–7152320.87318.2%5.5

Iron Ingot
1–5152320.58218.2%5.5

Emerald
1–3152320.38818.2%5.5

Nothing
1152320.19418.2%5.5

Iron Horse Armor
1152320.19418.2%5.5

Gold Horse Armor
1102320.12912.4%8.1

Diamond
1–352320.1296.3%15.8

Diamond Horse Armor
152320.0656.3%15.8

Golden Apple (Enchanted)
122320.0262.6%39.0

{{LootChest|jungle}}

Cada templo de la selva cofre contiene 2–6 pilas de objetos, con la siguiente distribución:

Stack Size Weight # Items Chance # Chests

Bone
4–620735.47972.2%1.4

Rotten Flesh
3–716734.38462.8%1.6

Gold Ingot
2–715733.69960.2%1.7

Iron Ingot
1–510731.64444.5%2.2

Diamond
1–33730.32915.5%6.5

Saddle
13730.16415.5%6.5

Emerald
1–32730.21910.5%9.5

Enchanted Book[note 3]
11730.0555.4%18.6

Iron Horse Armor
11730.0555.4%18.6

Gold Horse Armor
11730.0555.4%18.6

Diamond Horse Armor
11730.0555.4%18.6

{{LootChest|dungeon}}

Cada dungeon cofre contiene 3 grupos de 1–3, 1–4, y 3 pilas de objetos, con la siguiente distribución:

Stack Size Weight # Items Chance # Chests
1–3× 1–4× 1–3× 1–4×

Bone
1–810403.37557.8%1.7

Gunpowder
1–810403.37557.8%1.7

Rotten Flesh
1–810403.37557.8%1.7

String
1–810403.37557.8%1.7

Wheat
1–4201251.00035.3%2.8

Bread
1201250.40035.3%2.8

Name Tag
1201270.31529.0%3.4

Saddle
1201270.31529.0%3.4

Coal
1–4151250.75027.4%3.7

Redstone
1–4151250.75027.4%3.7

Music Disc (13)
1151270.23622.2%4.5

Music Disc (Cat)
1151270.23622.2%4.5

Iron Horse Armor
1151270.23622.2%4.5

Golden Apple (Normal)
1151270.23622.2%4.5

Beetroot Seeds
2–4101250.60018.8%5.3

Melon Seeds
2–4101250.60018.8%5.3

Pumpkin Seeds
2–4101250.60018.8%5.3

Iron Ingot
1–4101250.50018.8%5.3

Bucket
1101250.20018.8%5.3

Enchanted Book[note 1]
1101270.15715.1%6.6

Gold Horse Armor
1101270.15715.1%6.6

Gold Ingot
1–451250.2509.7%10.3

Diamond Horse Armor
151270.0797.7%13.0

Golden Apple (Enchanted)
121270.0313.1%32.0

{{LootChest|igloo}}

Cada igloo cofre contiene 2 grupos de 2–8 y 1 pilas de objetos, con la siguiente distribución:

Stack Size Weight # Items Chance # Chests
2–8× 2–8×

Golden Apple (Normal)
1111.000100.0%1.0

Coal
1–415632.97674.3%1.3

Apple
1–315632.38174.3%1.3

Wheat
2–310631.98457.9%1.7

Gold Nugget
1–310631.58757.9%1.7

Rotten Flesh
110630.79457.9%1.7

Stone Axe
12630.15914.9%6.7

Emerald
11630.0797.7%13.0

{{LootChest|mineshaft}}

Cada mineshaft cofre contiene 3 grupos de 1, 2–4, y 3 pilas de objetos, con la siguiente distribución:

Stack Size Weight # Items Chance # Chests
2–4× 2–4×

Rails
4–820507.20078.4%1.3

Torch
1–1615507.65065.7%1.5

Bread
1–315831.08445.0%2.2

Name Tag
130710.42342.3%2.4

Coal
3–810831.98832.0%3.1

Beetroot Seeds
2–410831.08432.0%3.1

Melon Seeds
2–410831.08432.0%3.1

Pumpkin Seeds
2–410831.08432.0%3.1

Iron Ingot
1–510831.08432.0%3.1

Golden Apple (Normal)
120710.28228.2%3.5

Activator Rails
1–45500.75027.1%3.7

Detector Rails
1–45500.75027.1%3.7

Powered Rails
1–45500.75027.1%3.7

Lapis Lazuli
4–95831.17517.0%5.9

Redstone
4–95831.17517.0%5.9

Gold Ingot
1–35830.36117.0%5.9

Enchanted Book[note 1]
110710.14114.1%7.1

Diamond
1–23830.16310.5%9.6

Nothing
15710.0707.0%14.2

Iron Pickaxe
15710.0707.0%14.2

Golden Apple (Enchanted)
11710.0141.4%71.0

{{LootChest|nether-fortress}}

Cada fortaleza del inframundo cofre contiene 2–4 pilas de objetos, con la siguiente distribución:

Stack Size Weight # Items Chance # Chests

Gold Ingot
1–315731.23349.8%2.0

Saddle
110730.41135.7%2.8

Gold Horse Armor
18730.32929.4%3.4

Nether Wart
3–75731.02719.2%5.2

Iron Ingot
1–55730.61619.2%5.2

Diamond
1–35730.41119.2%5.2

Flint and Steel
15730.20519.2%5.2

Iron Horse Armor
15730.20519.2%5.2

Golden Sword
15730.20519.2%5.2

Golden Chestplate
15730.20519.2%5.2

Diamond Horse Armor
13730.12311.8%8.5

Obsidian
2–42730.2478.0%12.5

{{LootChest|fortress}}

Cada fortaleza del inframundo cofre contiene 2–4 pilas de objetos, con la siguiente distribución:

Stack Size Weight # Items Chance # Chests

Gold Ingot
1–315731.23349.8%2.0

Saddle
110730.41135.7%2.8

Gold Horse Armor
18730.32929.4%3.4

Nether Wart
3–75731.02719.2%5.2

Iron Ingot
1–55730.61619.2%5.2

Diamond
1–35730.41119.2%5.2

Flint and Steel
15730.20519.2%5.2

Iron Horse Armor
15730.20519.2%5.2

Golden Sword
15730.20519.2%5.2

Golden Chestplate
15730.20519.2%5.2

Diamond Horse Armor
13730.12311.8%8.5

Obsidian
2–42730.2478.0%12.5

{{LootChest|village}}

Cada village blacksmith cofre contiene 3–8 pilas de objetos, con la siguiente distribución:

Stack Size Weight # Items Chance # Chests

Apple
1–315941.75561.6%1.6

Bread
1–315941.75561.6%1.6

Iron Ingot
1–510941.75546.1%2.2

Oak Sapling
3–75941.46326.0%3.9

Obsidian
3–75941.46326.0%3.9

Gold Ingot
1–35940.58526.0%3.9

Iron Pickaxe
15940.29326.0%3.9

Iron Sword
15940.29326.0%3.9

Iron Helmet
15940.29326.0%3.9

Iron Chestplate
15940.29326.0%3.9

Iron Leggings
15940.29326.0%3.9

Iron Boots
15940.29326.0%3.9

Diamond
1–33940.35116.3%6.1

Saddle
13940.17616.3%6.1

Iron Horse Armor
11940.0595.7%17.5

Gold Horse Armor
11940.0595.7%17.5

Diamond Horse Armor
11940.0595.7%17.5

{{LootChest|village|chance}}

Los valores representan las probabilidades de conseguir cualquiera de este material en un solo cofre.
Cada village blacksmith cofre contiene 3–8 pilas de objetos, con la siguiente distribución:

Chance

Apple
61.6%

Bread
61.6%

Iron Ingot
46.1%

Oak Sapling
26.0%

Obsidian
26.0%

Gold Ingot
26.0%

Iron Pickaxe
26.0%

Iron Sword
26.0%

Iron Helmet
26.0%

Iron Chestplate
26.0%

Iron Leggings
26.0%

Iron Boots
26.0%

Diamond
16.3%

Saddle
16.3%

Iron Horse Armor
5.7%

Gold Horse Armor
5.7%

Diamond Horse Armor
5.7%

Notas

  1. Todos los encantamientos son igualmente probables, y cualquier nivel de encantamiento es igualmente probable.
  2. Los objetos encantados del mismo tipo en el mismo cofre tendrán los mismos encantos. Las probabilidades de encanto son las mismas que de un nivel 20 a un nivel 39 de encanto en una mesa de encantamientos.
  3. Los libros encantados que se encuentren en el mismo cofre tendrán los mismos encantos (no en la 1.9. Las probabilidades de encantamiento son las mismas que un hechizo de nivel 30 en una mesa de encantamientos, pero la posibilidad de múltiples encantos no se reduce.




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 avg_rolls = ( min_pool_rolls + max_pool_rolls ) / 2
		local relativeweight = item_weight / pool_total_item_weight
		
		return 1 - math.pow( 1 - relativeweight, avg_rolls )
		
	end,
	
	dev = 'En la {{1.9}}, ',
	
	-- 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-wood"]         = { "block", link="Wood", title="Acacia or Dark Oak Wood", plural=false },
		["acacia-wood-only"]    = { "block", id='acacia-wood', link="Wood", title="Acacia Wood", plural=false },
		["activator-rail"]      = { "block", title="Activator Rails", plural=false },
		["apple"]               = { "item" },
		["beetroot-seeds"]      = { "item", link="Beetroot Seeds", plural=false },
		["bone"]                = { "item" },
		["book"]                = { "item" },
		["bread"]               = { "item", plural=false },
		["bucket"]              = { "item" },
		["coal"]                = { "item", plural=false },
		["compass"]             = { "item" },
		["detector-rail"]       = { "block", title="Detector Rails", plural=false },
		["diamond"]             = { "item" },
		["disc-13"]             = { "item", title="Music Disc (13)", link="Music Disc", cannot_stack=true, plural=false },
		["disc-cat"]            = { "item", title="Music Disc (Cat)", link="Music Disc", cannot_stack=true, plural=false },
		["emerald"]             = { "item" },
		["empty-map"]           = { "item", link="Map", title="Empty Map" },
		["enchanted-book"]      = { "item", cannot_stack=true, note="level-book" },
		["enchanted-book-rnd"]  = { "item", id='enchanted-book', title="Enchanted Book", link="Enchanted Book", cannot_stack=true, note="random-book" },
		["ender-pearl"]         = { "item" },
		["flint-and-steel"]     = { "item", cannot_stack=true, plural=false },
		["golden-apple"]        = { "item", title="Golden Apple (Normal)", plural="Golden Apples (Normal)" },
		["golden-chestplate"]   = { "item", link="Armor", cannot_stack=true },
		["golden-sword"]        = { "item", link="Sword", cannot_stack=true },
		["gold-ingot"]          = { "item" },
		["gold-nugget"]         = { "item" },
		["gunpowder"]           = { "item", plural=false },
		["horse-armor-diamond"] = { "item", title="Diamond Horse Armor", link="Horse Armor", cannot_stack=true, plural=false },
		["horse-armor-gold"]    = { "item", title="Gold Horse Armor", link="Horse Armor", cannot_stack=true, plural=false },
		["horse-armor-iron"]    = { "item", title="Iron Horse Armor", link="Horse Armor", cannot_stack=true, plural=false },
		["iron-boots"]          = { "item", link="Armor", cannot_stack=true, plural=false },
		["iron-chestplate"]     = { "item", link="Armor", cannot_stack=true },
		["iron-helmet"]         = { "item", link="Armor", cannot_stack=true },
		["iron-ingot"]          = { "item" },
		["iron-leggings"]       = { "item", link="Armor", cannot_stack=true, plural=false },
		["iron-pickaxe"]        = { "item", link="Pickaxe", cannot_stack=true },
		["iron-sword"]          = { "item", link="Sword", cannot_stack=true },
		["lapis-lazuli"]        = { "item", plural=false },
		["melon-seeds"]         = { "item", plural=false },
		["name-tag"]            = { "item" },
		["notch-apple"]         = { "item", id='golden-apple', link="Golden Apple", title="Golden Apple (Enchanted)", plural="Golden Apples (Enchanted)" },
		["nether-wart"]         = { "item", plural=false },
		["oak-sapling"]         = { "block", link="Sapling" },
		["oak-wood"]            = { "block", link="Wood", title="Oak, Spruce, Birch or Jungle Wood", plural=false },
		["oak-wood-only"]       = { "block", id='oak-wood', link="Wood", title="Oak Wood", plural=false },
		["obsidian"]            = { "block", plural=false },
		["paper"]               = { "item", plural=false },
		["powered-rail"]        = { "block", title="Powered Rails", plural=false },
		["pumpkin-seeds"]       = { "item", plural=false },
		["rail"]                = { "block", title="Rails", plural=false },
		["redstone"]            = { "item", plural=false },
		["rotten-flesh"]        = { "item", plural=false },
		["sand"]                = { "block", plural=false },
		["saddle"]              = { "item", cannot_stack=true },
		["raw-salmon"]          = { "item", plural=false },
		["spider-eye"]          = { "item" },
		["stick"]               = { "item" },
		["stone-axe"]           = { "item", link="Axe", cannot_stack=true },
		["stone-pickaxe"]       = { "item", link="Pickaxe", cannot_stack=true },
		["string"]              = { "item", plural=false },
		["torch"]               = { "block" },
		["wheat"]               = { "item", plural=false },
		["wood-planks"]         = { "block", title="Oak Wood Planks", plural=false },
		["wooden-axe"]          = { "item", link="Axe", cannot_stack=true },
		["wooden-pickaxe"]      = { "item", link="Pickaxe", cannot_stack=true },

		["enchanted-diamond-boots"]      = { "item", id="diamond-boots", link="Diamond Boots", note="end-ench-equipment", cannot_stack=true, plural=false },
		["enchanted-diamond-chestplate"] = { "item", id="diamond-chestplate", link="Diamond Chestplate", note="end-ench-equipment", cannot_stack=true },
		["enchanted-diamond-helmet"]     = { "item", id="diamond-helmet", link="Diamond Helmet", note="end-ench-equipment", cannot_stack=true },
		["enchanted-diamond-leggings"]   = { "item", id="diamond-leggings", link="Diamond Leggings", note="end-ench-equipment", cannot_stack=true, plural=false },
		["enchanted-diamond-pickaxe"]    = { "item", id="diamond-pickaxe", link="Diamond Pickaxe", note="end-ench-equipment", cannot_stack=true },
		["enchanted-diamond-shovel"]     = { "item", id="diamond-shovel", link="Diamond Shovel", note="end-ench-equipment", cannot_stack=true },
		["enchanted-diamond-sword"]      = { "item", id="diamond-sword", link="Diamond Sword", note="end-ench-equipment", cannot_stack=true },
		["enchanted-iron-boots"]         = { "item", id="iron-boots", link="Iron Boots", note="end-ench-equipment", cannot_stack=true, plural=false },
		["enchanted-iron-chestplate"]    = { "item", id="iron-chestplate", link="Iron Chestplate", note="end-ench-equipment", cannot_stack=true },
		["enchanted-iron-helmet"]        = { "item", id="iron-helmet", link="Iron Helmet", note="end-ench-equipment", cannot_stack=true },
		["enchanted-iron-leggings"]      = { "item", id="iron-leggings", link="Iron Leggings", note="end-ench-equipment", cannot_stack=true, plural=false },
		["enchanted-iron-pickaxe"]       = { "item", id="iron-pickaxe", link="Iron Pickaxe", note="end-ench-equipment", cannot_stack=true },
		["enchanted-iron-shovel"]        = { "item", id="iron-shovel", link="Iron Shovel", note="end-ench-equipment", cannot_stack=true },
		["enchanted-iron-sword"]         = { "item", id="iron-sword", link="Iron Sword", note="end-ench-equipment", cannot_stack=true },

		["empty"]                        = { "block", id="air", link='', title='Nothing', plural=false },
	},

	notes = {
		["level-book"] = "<ref group='note' name='level-book'>Los libros encantados que se encuentren en el mismo cofre tendrán los mismos encantos (no en la {{1.9}}. Las probabilidades de encantamiento son las mismas que un hechizo de nivel 30 en una [[mesa de encantamientos]], pero la posibilidad de múltiples encantos no se reduce.</ref>",
		["end-ench-equipment"] = "<ref group='note' name='end-city-enchantment'>Los objetos encantados del mismo tipo en el mismo cofre tendrán los mismos encantos. Las probabilidades de encanto son las mismas que de un nivel 20 a un nivel 39<!-- Sí, realmente 39 a pesar de que la mesa normalmente sólo va hasta 30 --> de encanto en una [[mesa de encantamientos]].</ref>",
		["random-book"] = "<ref group='note' name='random-book'>Todos los encantamientos son igualmente probables, y cualquier nivel de encantamiento es igualmente probable.</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 = {
		["village-blacksmith"] = { -- village_blacksmith.json
			header = "[[Aldea]]",
			link   = "[[Aldea]]",
			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},
						["horse-armor-iron"]    = {1,1,1},
						["horse-armor-gold"]    = {1,1,1},
						["horse-armor-diamond"] = {1,1,1},
						["saddle"]              = {1,1,3}
					}
				},
			}
		},
		["stronghold-altar"] = { -- stronghold_corridor.json
			header      = "Altar",
			superheader = "[[Fortaleza]]",
			link        = "[[Fortaleza]]",
			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},
						["horse-armor-iron"]    = {1,1,1},
						["horse-armor-gold"]    = {1,1,1},
						["horse-armor-diamond"] = {1,1,1},
						["enchanted-book"]      = {1,1,1},
					}
				},
			}
		},
		["stronghold-library"] = { -- stronghold_library.json
			header      = "Biblioteca",
			superheader = "[[Fortaleza]]",
			link        = "[[Fortaleza]]",
			pools = {
				{
					rolls = {1,4},
					items = {
						["enchanted-book"]      = {1,5,2},
						["book"]                = {1,3,20},
						["paper"]               = {2,7,20},
						["empty-map"]           = {1,1,1},
						["compass"]             = {1,1,1}
					}
				},
			},
			poolsDev = {
				{
					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},
					}
				},
			}
		},
		["stronghold-storeroom"] = { -- stronghold_crossing.json
			header      = "Despensa",
			superheader = "[[Fortaleza]]",
			link        = "[[Fortaleza]]",
			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},
					}
				},
			}
		},
		["bonus"] = { -- spawn_bonus_chest.json
			header = "[[Chest|Bonus]]",
			link   = "[[Chest|bonus]]",
			pools = {
				{
					rolls = {10,10},
					items = {
						["bread"]               = {2,3,3},
						["apple"]               = {2,3,5},
						["stick"]               = {1,3,10},
						["wood-planks"]         = {1,3,10},
						["oak-wood-only"]       = {1,3,10},
						["acacia-wood-only"]    = {1,3,10},
						["stone-axe"]           = {1,1,3},
						["wooden-axe"]          = {1,1,5},
						["stone-pickaxe"]       = {1,1,3},
						["wooden-pickaxe"]      = {1,1,5}
					}
				},
			},
			poolsDev = {
				{
					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},
						["wood-planks"]         = {1,12,10},
						["oak-wood"]            = {1,3,10},
						["acacia-wood"]         = {1,3,10},
					}
				},
			}
		},
		["dungeon"] = { -- simple_dungeon.json
			header = "[[Mazmorra]]",
			link   = "[[Mazmorra]]",
			pools = {
				{
					rolls = {8,8},
					items = {
						["iron-ingot"]          = {1,4,10},
						["bread"]               = {1,1,10},
						["horse-armor-iron"]    = {1,1,5},
						["horse-armor-gold"]    = {1,1,2},
						["horse-armor-diamond"] = {1,1,1},
						["redstone"]            = {1,4,10},
						["golden-apple"]        = {1,1,1},
						["saddle"]              = {1,1,10},
						["wheat"]               = {1,4,10},
						["gunpowder"]           = {1,4,10},
						["string"]              = {1,4,10},
						["bucket"]              = {1,1,10},
						["disc-13"]             = {1,1,4},
						["disc-cat"]            = {1,1,4},
						["name-tag"]            = {1,1,10},
						["enchanted-book"]      = {1,1,1}
					}
				}
			},
			poolsDev = {
				{
					rolls = {1,3},
					items = {
						["saddle"]              = {1,1,20},
						["golden-apple"]        = {1,1,15},
						["notch-apple"]         = {1,1,2},
						["disc-13"]             = {1,1,15},
						["disc-cat"]            = {1,1,15},
						["name-tag"]            = {1,1,20},
						["horse-armor-gold"]    = {1,1,10},
						["horse-armor-iron"]    = {1,1,15},
						["horse-armor-diamond"] = {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},
					}
				},
			}
		},
		["mineshaft"] = { -- abandoned_mineshaft.json
			header = "[[Minas abandonadas|Mina]]",
			link   = "[[Minas abandonadas]]",
			pools = {
				{
					rolls = {3,6},
					items = {
						["diamond"]             = {1,2,3},
						["iron-ingot"]          = {1,5,10},
						["gold-ingot"]          = {1,3,5},
						["bread"]               = {1,3,15},
						["iron-pickaxe"]        = {1,1,1},
						["horse-armor-iron"]    = {1,1,1},
						["redstone"]            = {4,9,5},
						["lapis-lazuli"]        = {4,9,5},
						["saddle"]              = {1,1,3},
						["enchanted-book"]      = {1,1,1},
						["coal"]                = {3,8,10},
						["rail"]                = {4,8,1},
						["melon-seeds"]         = {2,4,10},
						["pumpkin-seeds"]       = {2,4,10}
					}
				},
			},
			poolsDev = {
				{
					rolls = {1,1},
					items = {
						["golden-apple"]        = {1,1,20},
						["notch-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},
					}
				},
			}
		},
		["nether-fortress"] = { -- nether_bridge.json
			header = "[[Fortaleza del Inframundo|Fortaleza del]]<br>[[Fortaleza del Inframundo|Inframundo]]",
			link   = "[[Fortaleza del Inframundo]]",
			pools = {
				{
					rolls = {2,5},
					items = {
						["diamond"]             = {1,3,5},
						["iron-ingot"]          = {1,5,5},
						["gold-ingot"]          = {1,3,15},
						["obsidian"]            = {2,4,2},
						["horse-armor-iron"]    = {1,1,5},
						["horse-armor-gold"]    = {1,1,8},
						["horse-armor-diamond"] = {1,1,3},
						["saddle"]              = {1,1,10},
						["golden-sword"]        = {1,1,5},
						["golden-chestplate"]   = {1,1,5},
						["flint-and-steel"]     = {1,1,5},
						["nether-wart"]         = {3,7,5}
					}
				},
			},
			poolsDev = {
				{
					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},
						["horse-armor-gold"]    = {1,1,8},
						["horse-armor-iron"]    = {1,1,5},
						["horse-armor-diamond"] = {1,1,3},
						["obsidian"]            = {2,4,2},
					}
				},
			}
		},
		["desert-temple"] = { -- desert_pyramid.json
			header = "[[Templo del desierto|Templo del]]<br>[[Templo del desierto|desierto]]",
			link   = "[[Templo del desierto]]",
			pools = {
				{
					rolls = {2,6},
					items = {
						["diamond"]             = {1,3,3},
						["iron-ingot"]          = {1,5,10},
						["gold-ingot"]          = {2,7,15},
						["emerald"]             = {1,3,2},
						["horse-armor-iron"]    = {1,1,1},
						["horse-armor-gold"]    = {1,1,1},
						["horse-armor-diamond"] = {1,1,1},
						["saddle"]              = {1,1,3},
						["enchanted-book"]      = {1,1,1},
						["bone"]                = {4,6,20},
						["rotten-flesh"]        = {3,7,16}
					}
				},
			},
			poolsDev = {
				{
					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},
						["horse-armor-iron"]    = {1,1,15},
						["horse-armor-gold"]    = {1,1,10},
						["horse-armor-diamond"] = {1,1,5},
						["enchanted-book-rnd"]  = {1,1,20},
						["golden-apple"]        = {1,1,20},
						["notch-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},
					}
				},
			}
		},
		["jungle-temple"] = { -- jungle-temple.json
			header = "[[Templo de la selva|Templo de]]<br>[[Templo de la selva|la selva]]",
			link   = "[[Templo de la selva]]",
			pools = {
				{
					rolls = {2,6},
					items = {
						["diamond"]             = {1,3,3},
 						["iron-ingot"]          = {1,5,10},
						["gold-ingot"]          = {2,7,15},
						["emerald"]             = {1,3,2},
						["horse-armor-iron"]    = {1,1,1},
						["horse-armor-gold"]    = {1,1,1},
						["horse-armor-diamond"] = {1,1,1},
						["saddle"]              = {1,1,3},
						["enchanted-book"]      = {1,1,1},
						["bone"]                = {4,6,20},
						["rotten-flesh"]        = {3,7,16}
					}
				},
			}
		},
		["end-city"] = { -- end_city_treasure.json
			header = "[[Ciudad del Fin|Ciudad]]<br>[[Ciudad del Fin|del Fin]]",
			link   = "[[Ciudad del Fin]]",
			poolsDev = {
				{
					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},
						["horse-armor-iron"]    = {1,1,1},
						["horse-armor-gold"]    = {1,1,1},
						["horse-armor-diamond"] = {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},
					}
				},
			}
		},
		["igloo"] = {
			header = "[[Iglú]]",
			link   = "[[Iglú]]",
			poolsDev = {
				{
					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},
					}
				},
			}
		},
	},

	-- 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",
		["village"] = "village-blacksmith",
		["blacksmith"] = "village-blacksmith",
		["altar"] = "stronghold-altar",
		["storeroom"] = "stronghold-storeroom",
		["library"] = "stronghold-library"
	},

	-- 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"] = "fortaleza del inframundo",
		["nether"] = "fortaleza del inframundo",
		["fortress"] = "fortaleza del inframundo",
		["desert"] = "templo del desierto",
		["jungle"] = "templo de la selva",
		["desert-temple"] = "templo del desierto",
		["jungle-temple"] = "templo de la selva"
	},
	
	-- these descriptions are used:
	-- * in column <abbr> titles,
	-- * and above the table when only a single column-type is chosen
	
	columns = {
		["stacksize"] = 'el tamaño de las pilas (o por número de objetos no apilables) de este objeto que se encuentran en este cofre.',
		["weight"] = 'la cantidad de este objeto en relación con otros objetos en el cofre.',
		["items"] = 'el número de objetos esperados por cada cofre, como promedio sobre un gran número de cofres.',
		["chance"] = 'las probabilidades de conseguir cualquiera de este material en un solo cofre.',
		["chests"] = 'el número de cofres esperados que buscar, para encontrar algo de este objeto.'
	},
	
	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;'>Module:LootChest: no valid arguments</span>"
	end

	q.fill_in_chest_derivative_data( chests )
	
	-- construct an ordered list dictating the order of the rows
	
	local ordered_item_rows, ordered_item_rows_dev

	local ret = {}
	if args.dev and args.dev ~= '0' then
		local ordered_item_rows = q.construct_ordered_item_rows( chests, 'Dev' )
		if q.tablelength( ordered_item_rows ) > 0 then
			table.insert( ret, q.print_table( chests, columns, ordered_item_rows, 'Dev' ) )
		end
	else
		local ordered_item_rows = q.construct_ordered_item_rows( chests, '' )
		local ordered_item_rows_dev = q.construct_ordered_item_rows( chests, 'Dev' )

		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
	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;">unknown item "' .. itemname .. '"</span>'
	end
	
	local chances, devChances
	if args.dev and args.dev ~= '0' then
		chances = q.single_item_find_values( itemname, 'poolsDev' )
		devChances = {}
	else
		chances = q.single_item_find_values( itemname, 'pools' )
		devChances = q.single_item_find_values( itemname, 'poolsDev' )
	end
	
	local html = {}

	if q.tablelength( chances ) > 0 then
		table.insert( html, p.base2_sub( itemname, chances ) )
	end
	if q.tablelength( devChances ) > 0 and q.compare_tables( chances, devChances ) then
		table.insert( html, p.current_frame:preprocess( p.dev ) .. q.lcfirst( p.base2_sub( itemname, devChances ) ) )
	end

	return table.concat( html, ' ' )
end

p.base2_sub = function( itemname, chances )
	local html = {}
	local item_display_name = ''
	
	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
	
	item_display_name = q.capitalize( item_display_name )
	
	table.insert( html, item_display_name )
	table.insert( html, ' se pueden encontrar ' )

	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 = { 'en ' }
		local c = 0
		local nc = q.tablelength( chest_details )
		local sep = q.tern( nc > 2, ', ', ' ' )
		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, 'y ' )
			end
			table.insert( html_per_stack, string.format("%.1f", chest.chance*100) )
			table.insert( html_per_stack, "% de " )
			if chest.chest_name == 'mineshaft' then
				table.insert( html_per_stack, ' [[Vagoneta con cofre|vagonetas con cofre]] en ' )
				table.insert( html_per_stack, p.chests[chest.chest_name].link )
			else
				table.insert( html_per_stack, p.chests[chest.chest_name].link )
				table.insert( html_per_stack, ' cofres' )
			end
			table.insert( html_per_stack, sep )
		end
		if nc > 2 then
			table.insert( html_per_stack, 'todo ' )
		end
		table.insert( html_per_stack, 'en ' )
		if p.items[itemname].cannot_stack ~= nil then
			table.insert( html_per_stack, 'grupos de ' )
		else
			table.insert( html_per_stack, 'pilas de ' )
		end
		table.insert( html_per_stack, stacksize )
	
		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, 'y ' )
		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 } .. '\n\n' )
	end

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

q = {

	tablelength = function(T)
		local count = 0
		for _ in pairs(T) do count = count + 1 end
		return count
	end,
	
	single_item_find_values = function( itemname, key )
	
		local chances = {}

		for chest_name, chest in pairs( p.chests ) do
			local poolchances = {}
			for k, pool in pairs( chest[key] 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
				if chances[stacksize] == nil then
					chances[stacksize] = {}
				end
				table.insert( chances[stacksize], { ["chance"]=chance, ["chest_name"]=chest_name } )
			end
		end

		return chances
		
	end,
	
	single_item_plural = function( itemname )
	
		if string.sub( itemname, -2 ) == 'ss' 
			or string.sub( itemname, -2 ) == 'ch' 
			or string.sub( itemname, -2 ) == 'sh' 
			or string.sub( itemname, -1 ) == 's' then 
				return itemname .. 'es' 
		end
		
		return itemname .. 's'
	
	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
				table.insert( chests, chest_name )
			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, q.tern( pool.rolls[1] == pool.rolls[2], pool.rolls[1], 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, q.tern( pool.rolls[1] == pool.rolls[2], pool.rolls[1], 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
		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] = q.tern( min_stacksize == max_stacksize, min_stacksize, 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
				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

		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 = ( 1 + q.tern( #chest_names > 1, 1, 0 ) + q.tern( use_superheader, 1, 0 ) )
		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, "Los valores representan " )
				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 display_name = p.chests[chest_name].display_name

			chest_name = chest_name:gsub( "-", " " )
			
			table.insert( html, "Cada " )
			table.insert( html, display_name or chest_name )
			table.insert( html, " cofre contiene " )
			if #allRolls == 1 then
				table.insert( html, allRolls[1] )
			else
				table.insert( html, #allRolls )
				table.insert( html, ' grupos de ' )
				local s = q.tern( #allRolls > 2, ', ', ' ' )
				for i = 1, #allRolls-1 do
					table.insert( html, allRolls[i] )
					table.insert( html, s )
				end
				table.insert( html, 'y ' )
				table.insert( html, allRolls[#allRolls] )
			end
			table.insert( html, " pilas de objetos, con la siguiente distribución: \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 - q.tern( hide_col_description, 1, 0 ) ) )
		table.insert( html, "></th>\n" )
		
		local superheader_cols_used = {}
		
		if #chest_names > 1 then
			local row1, row2 = {}, {}

			for i = 1, #chest_names do
				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 = q.tern( #allRolls > 2, ', ', ' ' )
						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
			
			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
				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, "'> Stack Size </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, "'> Weight" )
					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, "'> # Items </abbr></th>\n" )
				end
				if columns['chance'] ~= nil then
					table.insert( html, headersort_th_open )
					table.insert( html, p.columns['chance'] )
					table.insert( html, "'> Chance </abbr></th>\n" )
				end
				if columns['chests'] ~= nil then
					table.insert( html, headersort_th_open )
					table.insert( html, p.columns['chests'] )
					table.insert( html, "'> # Chests </abbr></th>\n" )
				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'>" )
							table.insert( html, allRolls[k] )
							table.insert( html, "×</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] )
								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] )
								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='0' style='text-align:center;'>—</td>" )
							end
						end
						if columns['weight'] ~= nil then
							for k = 1, allRollsSpan do
								table.insert( html, "<td data-sort-value='0' style='text-align:center;'>—</td>" )
							end
						end
						if columns['items'] ~= nil then
							table.insert( html, "<td data-sort-value='0' style='text-align:center;'>—</td>" )
						end
						if columns['chance'] ~= nil then
							table.insert( html, "<td data-sort-value='0' 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,'-',' ')), 
							settings= q.tern( item[1] == 'item', 'ItemSprite', '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,
	
	tern = function( cond , T , F )
		if cond then return T else return F end
	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