EDIT
So here's the scoop.
It's impossible to get a Mending book from a loot chest or from fishing in 15w43c. The reason is that it requires a >30 level enchant, and all the LootTables in the world (e.g. dungeon chests, fishing, ...) only enchant with level 30, except for end cities, which enchant from 20-39. But End Cities do not have books among their loot!
So the only way to get a Mending book today is via villager trading. This will just drive everyone away from exploring, since the best loot cannot be found via exploration. This is probably not intended.
I don't know the exact Mending calculations, but some I ran some simulations with custom DeathLootTables to discover that Mending books are about...
0.0% of books enchanted at level 30
0.6% of books enchanted at level 20-39
4.0% of books enchanted at level 40
At the end of the day, it should somehow be possible (but rare) to obtain this book from world exploration. There are a variety of knobs available (loot table level min/max, overall behavior of Mending as treasure enchant, weight-likelihood of books in chests, ...) for devs to tweak this to be the 'right' level. But I'm guessing 'zero' was not the intended level, and that's where we're at now. (Beware the interplay; e.g. level 40 makes Mending 'reasonable' but 'Frost Walker' become vanishingly rare.)
ORIGINAL
I did an experiment to see what the distribution of enchanted books from dungeon chests was like. It is not good:
1 Projectile Protection
12 Silk Touch
21 Feather Falling
31 Infinity
38 Thorns
39 Fortune
41 Punch
42 Blast Protection
42 Luck of the Sea
45 Fire Aspect
46 Lure
48 Aqua Affinity
48 Respiration
48 Flame
49 Looting
60 Frost Walker
68 Depth Strider
98 Fire Protection
104 Smite
115 Knockback
129 Bane of Arthropods
134 Unbreaking
193 Sharpness
232 Protection
233 Efficiency
247 Power
1174 books
Over 1100 books, and no Mending! There's "super rare", and then there's "no one will ever get it".
If you want to test the distribution yourself, here is a command block program to help:
Make a 'The Void' world. Put this loot table
{
"pools": [
{
"rolls": 27,
"entries": [
{
"type": "item",
"name": "minecraft:book",
"weight": 1,
"functions": [
{
"function": "enchant_with_levels",
"levels": 30,
"treasure": true
}
]
}
]
}
]
}{
"pools": [
{
"rolls": 27,
"entries": [
{
"type": "item",
"name": "minecraft:book",
"weight": 1,
"functions": [
{
"function": "enchant_with_levels",
"levels": 30,
"treasure": true
}
]
}
]
}
]
}in "WORLD\data\loot_tables\ns\folder\mine.json"
Run
summon ArmorStand 0 4 0 {NoGravity:1}summon ArmorStand 0 4 0 {NoGravity:1}Then make a loop that runs
/execute @e[type=ArmorStand] ~ ~2 ~ setblock ~ ~ ~ chest 0 replace
/execute @e[type=ArmorStand] ~ ~3 ~ setblock ~ ~ ~ hopper 0 replace
/tp @e[type=ArmorStand] ~2 ~ ~
/execute @e[type=ArmorStand] ~ ~4 ~ setblock ~ ~ ~ chest 0 replace {LootTable:"ns:folder/mine"}/execute @e[type=ArmorStand] ~ ~2 ~ setblock ~ ~ ~ chest 0 replace
/execute @e[type=ArmorStand] ~ ~3 ~ setblock ~ ~ ~ hopper 0 replace
/tp @e[type=ArmorStand] ~2 ~ ~
/execute @e[type=ArmorStand] ~ ~4 ~ setblock ~ ~ ~ chest 0 replace {LootTable:"ns:folder/mine"}for a few seconds. Then wait a few seconds for hoppers to suck out all the books into the lower chests. Now analyze all the books.
Linked issues
relates to 1
Comments 18
I know that people have seen Mending in Villager trades, which makes me think there's a bug/difference in the code path for 'treasure' loot tables versus treasure villager books.
I was thinking you somehow messed up the treasure flag, but you got Frost Walker as well. Confirmed.
They need bigger lvl of enchanting than 30. It can be only found in end cities chests, which have 40 lvl enchantments. Unfortunately in the end chests there can't be books.
Even if 0.6% mending and 3.3% frost walker is seen by the devs as too high, the enchants could always be level 20-35 or similar.
Hurray! Now randomly_enchant gives each kind of enchant equal weight, so 'mending' and 'silk touch' and whatnot are 3.84% in each dungeon/mineshaft chest.
They added the tag "randomly_enchant" to most structures except stronghold_crossing, stronghold_library, stronghold_corridor, jungle_temple. Maybe intended?
As of 06/02/16: I have a fish farm. As of the original date I have AFKed for about 3 days (while at work). This totals to about 30 hours. In that time I received an average of about 33-34 enchanted books. So 100 books. Out of those 100 books I was able to get a single mending book, and a single frost walker II book. So this is about a 1% chance. One would have to farm for about 30 hours to have a chance to get one or the other or maybe I am doing this wrong and could say 15 hours to get one or the other since I was able to get both in 30 hours. None the less you need a fully enchanted fishing rod to do so (luck of the sea III, lure III, mending, and unbreakable III)... and a lot of time.
So I can tell you it is currently working in 1.9.4; it is just VERY rare.
Also this is only true if Frost Walker and Mending have an equal chance. If they do not then I need to collect more stats.
More data, no mending after 7000 books
16 Projectile Protection
135 Feather Falling
151 Silk Touch
158 Thorns
169 Infinity
243 Blast Protection
286 Punch
287 Respiration
288 Lure
292 Frost Walker
294 Fortune
296 Depth Strider
302 Flame
308 Fire Aspect
310 Aqua Affinity
326 Luck of the Sea
332 Looting
628 Bane of Arthropods
649 Smite
681 Fire Protection
754 Knockback
792 Unbreaking
1244 Sharpness
1360 Protection
1414 Efficiency
1443 Power
6982 books