Talk:Anvil Mechanics/Before 1.8

Hey all

I've done lots of testing on the anvils in snapshot 12w41b, and made a wiki page on it based on what people were telling me on Reddit and the forums. Feel free to change it and make it look better/make more sense (it's quite late here and I've not had much experience with making a wiki page, so I'm sure there's plenty of ways to make it better :))

Opaquer 15:29, 17 October 2012 (UTC)

Snapshot 12w42b repairing with resource
I've done some quick testing on the newest snapshot (12w42b) and found that when repairing an item with a resource, each resource will add 25% of the item's total durability (rounded down). Meaning, an item with durability 1561 (Diamond toos, diamond sword) will be repaired for 390 durability points for each diamond put in the anvil. –Preceding unsigned comment was added by 90.184.186.178 (Talk&#124;Contribs) 06:49, October 19, 2012‎ (UTC). Please sign your posts with

Any reason not to combine slot tables?
The page would gain readability if the "Slot 1" and"Slot 2" tables were merged into one 3-column table. --Mental Mouse 19:55, 24 October 2012 (UTC)

Changed format
I did as Mental Mouse suggested and changed the tables to a 3 column table instead. Let me know how it goes. Feel free to change the formatting.

Also, if anyone is up for helping figure out a formula that's more complete for items with no links, let me know through the forums (user opaquer). It would be greatly appreciated! Opaquer 12:36, 25 October 2012 (UTC)


 * Thanks! I'm probably going to shorten those headers.  I note that the text is incomplete and vague, e.g.  Cost for "having the item in the first slot"?   Discusses merging, but does that also apply to repair by adding materials?  For that matter, repair with materials isn't covered at all, nor is renaming.  (And does that work for bows?  What material?)  --Mental Mouse 11:48, 25 October 2012 (UTC)


 * All good! Please do change it to make it better; I was in a rush this morning when I did it. I had to go to a tute at 9AM, and 5 minutes before it started, I looked at the clock, realised what time it was, finished making it not be all over the place and hit submit :P. So I can imagine a lot of stuff is all over the place :P


 * As for the the repairing/renaming etc. I haven't yet figured out an easy way to work it out. If anyone is up for helping me figure this out, let me know! There are some formulas around that help with the merging, but I haven't had them working for anything other than what mine is, but they're a lot more complicated than my method. If anyone wants to help me though, let me know and we can work something out :) Opaquer 12:36, 25 October 2012 (UTC)

Different algorithm in final 1.4.2 release?
Either this set of tables is confusing to me, or flat-out wrong. On the new 1.4.2 release, I've been trying to combine tools using an anvil, and getting much higher costs than those listed.

Example 1: Diamond Pick 1 - Efficiency IV, Fortune III, barely used at all. Diamond Pick 2 - Unbreaking III, a bit less than half durability remaining.

Going by the rules and tables on the wiki, this should cost me: 5 levels for the pick in slot one having Efficiency IV. 13 levels for the pick in slot one having Fortune III. 1 level for the pick in slot one having two (one extra) enchantments. 2 levels for the pick in slot two having Unbreaking III. 0 levels for the pick in slot two having only one (no extra) enchantment. 21 total levels, right? So why does it cost more than 40 levels and produce the "too expensive" error?

Example 2: Diamond Pick 1 - Efficiency IV, Fortune III, barely used at all. Same as in example 1. Diamond Pick 2 -- Fortune III, worn down to a bare nub. Going by the rules and tables on the wiki, this should cost me: 5 levels for the pick in slot one having Efficiency IV. 13 levels for the pick in slot one having Fortune III. 1 level for the pick in slot one having two (one extra) enchantments. 4 levels for the pick in slot two having Fortune III. 0 levels for the pick in slot two having only one (no extra) enchantment. 23 total levels, right? So why does it cost 28 levels to get the resulting full-durability Eff4/Fort3 Pick?

The first example obviously isn't costing me 19+ levels for the repair, when the second example does more repair work and has only an extra 5 levels above that expected from the tables and formula. Even adding a few extra levels for the output pick having 3 enchantments rather than 2 can't explain 20 or more levels of difference.

Example 3: Diamond Pick 1: Efficiency IV, Fortune II, Unbreaking III, completely unused. Diamond Pick 3: Fortune III, worn down to a bare nub, same as in example 2. Going by the rules and tables on the wiki, this should cost me: 5 levels for the pick in slot one having Efficiency IV. 9 levels for the pick in slot one having Fortune III. 7 levels for the pick in slot one having Unbreaking III 3 levels for the pick in slot one having three (two extra) enchantments. 4 levels for the pick in slot two having Fortune III. 0 levels for the pick in slot two having only one (no extra) enchantment. 28 total levels, right? So why does it cost 33 levels to get the expected Eff4/Fort3/Unbr3 Pick? 39 if I also want to rename it. That's six levels to name it, not five as the Anvil article states. I didn't try renaming on the other examples.

That's three examples I've tried, and none of them produce the expected cost. What am I doing wrong, or has the algorithm changed? 99.141.53.167 04:42, 26 October 2012 (UTC)


 * Hey! So, with the mechanics. This is for combining two items that have a common item between them and haven't been used at all. For repairing, the costs are more. Unfortunately, I haven't been able to find out the formula for repairing items yet, or combining things that have no common links between then :(. Still trying though. That said, if anyone wants to help, please do :) Opaquer 12:14, 26 October 2012 (UTC)


 * I also had some problems with the wiki numbers. I tried repairing a renamed Eff V Dur III diamond shovel using a non-enchanted diamond shovel, and the in-game level cost is always much higher than what I calculate using the wiki formulas. -- If I do the repair (in other words, transfer the enchantments from the worn enchanted shovel to a brand new one), it costs me 27 levels. Since the enchanted pick is the Sacrifice Item (in the right slot), the cost should be 18: Repair cost (at 90 remaining durability this gives +2 to the cost according to the wiki table), transferring enchantments Eff V Dur III gives a cost of 5*1 + 2*3 = 11 and the "extra cost" X*(T-1)+1 which becomes 2*(2-1)+1 = 3. Finally add the Prior Work costs, 2 for the renamed item and 0 for a brand new one. Total 2+11+2+3 = 18, yet the game demands 27 levels. (Before renaming, the same cost was 29.) -- Furthermore, the level cost didn't depend on the durability of the (enchanted) Sacrifice Item. I tried wearing it out from full to nothing and the cost didn't change at any point (again, with a non-used diamond shovel as Target Item). The wiki article suggests that Sacrifice Item durability always matters... and it does indeed seem to: if I instead use the enchanted shovel as Target Item and attempt to repair it with non-enchanted shovels worn out to varying degrees. So, for the non-enchanted shovels, durability matters both as Target and as Sacrifice, but durability doesn't matter when it comes to the enchanted E5D3 shovel (at least not as Sacrifice). This is in version 1.5.1 btw. --82.181.178.253 08:58, 26 April 2013 (UTC)

Partial cleanup, need help.
I've cleaned up the article based on what was there, but the original text was inconsistent, doesn't completely match the tables, and the combination doesn't seem to work right. Notably, the tables suggest that putting the higher enchanted item in the first slot would not be cheaper, and that it would be much cheaper to add, say, Fortune III to Unbreaking I than vice versa. These are my guesses for what it "should" say, but not having tested anything (much less read the source), I'm wary of putting them in without confirmation: --Mental Mouse 13:11, 26 October 2012 (UTC)
 * 1) The "First slot" cost applies to the final item, not the target item.
 * 2) The "Second slot" cost is constant for each enchantment type that's in the "sacrificed" item, but is halved (only) if maxed-out and combining with a matching enchantment.  One big question is if you pay for an enchantment that doesn't make it into the target item at all (Smite over Sharpness), or is masked (Smite I over Smite II) -- my guess is yes.  I'm now thinking that suggesting the slot tables be combined may have been a mistake on my part -- if so, the second slot should get a separate, much shorter, table.)
 * 3) I don't know whether straight "repairs" (say, by adding diamonds) count as "going through the anvil" for the penalty.
 * 4) Similarly, I don't know if "lost" enchantments as above stay in the result's "running cost".
 * 5) ETA:  Also, it'd be nice to know the penalties for using damaged items.


 * Hey! So:
 * What do you mean?
 * I agree with what you said: Adding a knockback 2 enchant with another item that has knockback 2 will only add an extra 2 levels. Is that what you mean? Also, I too suspect that you pay for enchants that don't make it through (in cases like smite over sharpness, you would still pay for the sharpness). As for, say, smite 3 over smite 1, I think it costs the same as smite 3, but gives the final sword a smite 3, and ignored the smite 1. Someone would have to check though
 * I highly suspect anything that comes out of the anvil's output slot will still get the +2 level penalty
 * A very good question indeed! We shall have to test it!
 * That too is a very good point. I probably won't have much time this week because of uni, but I'm more than happy to talk about it and try work out numbers. Do you have an account on the forums so we can talk to each other directly if need be rather than keep editing this page :P?

Opaquer 02:39, 27 October 2012 (UTC)

Some repair costs
So far I've gotten: Unenchanted items cost 1 for each unit of material used to repair them. Enchanted items cost more: My worn-down Smite II diamond sword would cost 9, 13, or 16 for 1, 2, or 3 diamonds worth of repair. A slightly better-off Knockback II sword would cost 9, 13, or 15. I wonder if that's a discount for not repairing very much with the last one....  Repairing a worn-down iron sword cost 1 for the first ingot, but would have 3 for the second, or 4 for two on the second repair. So, it looks like repair does give the 2-level penalty. ETA: Neither string nor sticks can be used to repair a bow, but you can combine it with a normal one. My Power 4 Punch 2 bow would cost 19 levels to do that. --Mental Mouse 01:47, 27 October 2012 (UTC)


 * 9, 13 or 16 makes a nice pattern of adding 4 each diamond. 9, 13 or 15 doesn't though. I think we need more exact data: Exactly how many uses for each item, how many diamonds, and differences between tiers. As for bows, perhaps there's no way to repair them. That's slightly annoying :( Opaquer 02:55, 27 October 2012 (UTC)
 * Well, combining an enchanted bow with a normal one has the same basic effect in one step, and a plain bow is pretty cheap. I'll note too that repairing unenchanted items with diamonds or ingots is a bargain for armour, not so much for unenchanted tools or swords. --Mental Mouse 15:27, 27 October 2012 (UTC)


 * That's true for the bows. The question is, how does putting a normal bow in with an enchanted bow compare to putting materials in with items? Opaquer 22:26, 27 October 2012 (UTC)

New costs
Hey guys

I might have just found out something that could be quite helpful. As such, I'm going to change the costs. The mechanics have not changed. But I'm just 'rescaling' the costs essentially. It just makes formulas quite a lot easier. Again: nothing else has changed! That said, some of the text might be a little out of date, probably about how the extra enchants. If it is, change it, because I probably missed it :) Opaquer 02:55, 27 October 2012 (UTC)

Update: Alright guys, stuff has been changed. I've also added a new section with the formulas, since some people would prefer formulas to tables. I couldn't quite figure out how to do math symbols, but if there's a way, it might make a bit more sense using a sum instead of how I have it now, unless people think it makes sense as is? Opaquer 04:09, 27 October 2012 (UTC)


 * Using a sigma would be a bit much, remember we've got 12-year olds about. The formula as seen is not rendering well on my system, I may see if I can make it look better.  That new section could actually replace the long tables, if you're confident in your results.  Also, I'd still like to know how those costs relate to repairing single items. --Mental Mouse 15:28, 27 October 2012 (UTC)


 * I would love to use a sigma, but I couldn't get the wiki to like me enough to make it work for me :P. If you can get math to work, that would be amazing! And yup, the results are exactly the same as the tables before, just 'scaled' differently so that you have those formulas instead of weird (2n+1) type things which might get confusing for those who don't like math as much as me :P. For the costs of repairing, I don't know when I'll get much of a chance to get on next and test it. I've sort of ignored my PhD for a week and a bit, and now I've got to catch up :P. But if you're up for doing the testing and need a second pair of eyes, I am more than happy to be that pair :P Opaquer 15:31, 27 October 2012 (UTC)

Math symbols and formula format
Found a hidden comment without a signature. Next time just post on the Talk page instead of using hidden comments. This way everyone will be able to see them regardless if they decide to edit/view the source or not. --M0rphzone(talk) 23:17, 27 October 2012 (UTC)


 * That hidden comment was me, sorry. Forgot about signing it, sorry. But I put it there instead because someone edited the wiki to say "This is not correct", so I made the hidden comment in case they decided to edit it again and didn't look at the talk page. Opaquer 11:24, 28 October 2012 (UTC)

"I have no idea how to type math in the wiki, so if there is a way and someone knows it, could you please fix this up to make it look better somehow :)?" Check Wikipedia for how they do it, and they might use some templates which you could use here as well. --M0rphzone(talk) 23:17, 27 October 2012 (UTC)


 * I did that. I tried using what wiki used for the sums and stuff, and it didn't work. Hence why I've had trouble with this. Unless there's something I'm missing (I'm not someone who makes wiki pages often, so that's certainly a possibility) Opaquer 11:24, 28 October 2012 (UTC)
 * I still think we should be using English text rather than a sigma: "For each enchantment, add in...".Lots of folks would just go WTF at a sigma, and in a case like this, it's just showing off.  --Mental Mouse 19:50, 28 October 2012 (UTC)


 * Yeah, that's why once I couldn't get it to work I gave up :P. Though, the mathematical part of me is really wishing there was a sigma there :P Opaquer 00:33, 29 October 2012 (UTC)

Great, but...
Tis is a great article, but it seems out of place for a tutorial. Mabey it could be placed similarly to the way that echanting has This article? It is a useful and detailed article, but not a tutorial. I am also not a fan of how it is in the enchanting section of the tutorial page, while their is no page on enchanting there. Pokechu22 00:14, 30 October 2012 (UTC)


 * It used to be like that article, and then someone changed it to be a tutorial :S. I'm not entirely sure what exactly they did to change it though, but if enough people don't think it should be a tutorial, I'm sure it can be changed back :) Opaquer 00:38, 30 October 2012 (UTC)
 * I agree, it should be a regular article. We do need more complete information, especially figuring out the materials-repair thing. --Mental Mouse 02:25, 30 October 2012 (UTC)


 * Agreed; the technical information here has more in common with the pages on file formats than the other tutorial how-to guides. -- Orthotope 05:27, 2 November 2012 (UTC)

Order of enchantments
Just to clarify it to people, the order of enchantments on a single item does not matter. A sword in the first slot that has Sharpness 4 and looting 3 will cost 19 levels, while swapping the order of the enchantments (to have a sword with looting 3, sharpness 4) will still cost 19 levels. That is not the same as saying a sharpness 4 sword in the left slot + a looting 3 sword in the right slot will cost the same if you swap the order around. Opaquer 23:04, 30 October 2012 (UTC)

Move page
Hey all. I moved the topic back to just Anvil Mechanics, not under tutorial any more Opaquer 09:02, 2 November 2012 (UTC)
 * Thanks! --Mental Mouse 12:37, 2 November 2012 (UTC)

Anvils and raw materials
Hi. i just did a little research on raw material repairing. I don't personally understand anvils that well and I have little experience on wikis but I'll post my findings here anyway.

Note: this research was done using golden pickaxes

Firstly, you can repair an item with multiple pieces of the raw material at once.

Secondly, the item WILL face the previously-combined penalty each time it is repaired with raw materials, though it will only face this penalty once even if multiple pieces of material are used.

Thirdly, repairing with raw material will cost enchantment levels. As i stated earlier, I don't understand anvils that well so I'll just post 3 separate cases with golden pickaxes:

1: Unenchanted pickaxe: Costs 1 level per ingot to repair. 2: Pickaxe with Efficiency III: Costs 4 levels + 2 levels per ingot used to repair (I.E 6 if 1 ingot was used, 8 if 2 are used etc). 3: Pickaxe with unbreaking III; Efficiency III: Costs 12 levels + 3 levels per ingot

Another thing i found was that if an item is stackable, then you can rename multiple pieces of that item at once. It costs 5 levels per item, But the cost is capped at 39. This means you can enchant an entire stack of blocks for 39 levels.

109.77.199.229 12:56, 3 November 2012 (UTC)Elektromag109.77.199.229 12:56, 3 November 2012 (UTC)

New Table layout
Hey all. Are we all OK with how the new tables are being changed under the formulas section? I think personally I'd prefer to have the increment values there, but that's just me? Opaquer 17:29, 3 November 2012 (UTC)
 * Wait what? Some nameless IP deleted the whole column without giving a reason, replacement, or justification?  Not changing the text, thus leaving orphaned references to increments and the second column, is also a hint this is vandalism.  No, this is not cool.   I'm reverting. --Mental Mouse 18:51, 3 November 2012 (UTC)
 * Despite my reflexive response above, it does seem that the increments are always the same as the base cost. Perhaps we should in fact combine the tables into one with 3 columns: "enchantment name", "1st slot per level", "2nd slot".  (And a note that the second slot costs half when combining maxed out enchantments).  Having an entry for every enchantment level makes excessively long tables.
 * (A tip for future editors: Even a proper change comment would have blunted my "revert vandalism" reaction; asking in this here talk page first, would have been much better.)

--Mental Mouse 23:41, 5 November 2012 (UTC)

Some research:
Got some interesting findings with gold swords (1.4.3): Anyone want to confirm these, perhaps with some armour? --Mental Mouse 23:07, 5 November 2012 (UTC)
 * The cost of repair with materials is the item's base cost plus a per-ingot cost, which does not vary with the damage to the sword -- you just need more ingots for a heavily-damaged sword. I believe the per-ingot cost is 1 plus the number of enchantments (regardless of level).
 * When repairing an enchanted sword with a plain one, the damage of the plain one does not affect the cost. Also, doing this will be cheaper in levels than even the one-ingot cost for repairing with materials.  The cost appears to be the base cost plus 1.
 * ETA: When combining two enchanted swords, that "plus 1" penalty appears and disappears, I haven't quite nailed down what the rules are.
 * ETA2: When repairing a sword with a "subset" sword (that is, the target sword will not change its enchantments), it costs the same as with a plain sword.
 * I would love to test that! Unfortunately, I'm at uni all day and I can't get Minecraft on my uni computer D:. Perhaps tonight when I get home if I've got time. Also, with the combining of two enchanted swords: If you've read my forum/reddit post, you'll know I tried some theories as to how to calculate the cost of combining two enchanted swords without common links, and some got very close to working. I had that same problem. I found a way to make it work, tested in on 5 swords, and it worked perfectly. Then I tried on one more to be 100% sure, and I was missing 1 level. Couldn't figure out where. Kept trying, and I was always correct or 1 level short. Still haven't figured out why this happens or where that level comes from :(. Opaquer 00:37, 6 November 2012 (UTC)
 * Hmm, I just realized the rule I had for material repair is not consistent with my prior experiments on diamond swords, where single-enchantment items had a per-ingot cost of 4. Sigh...   Opaquer:  Were you getting different costs for identical combinations?  If so, you should probably report that as a likely bug. --Mental Mouse 02:04, 6 November 2012 (UTC)
 * Hmm. Maybe each tier has a different cost? So, fixing diamond stuff costs more than gold stuff? And how so for the different costs for identical combinations? As in, did I find that to combine a sharpness 4 with a looting 3 cost however many levels, but getting the same thing a different way cost differently? Well, it depends on how the swords are, but for the most part, no. What I meant was that in one of my theories to calculate the exact cost needed to combine enchantments, sometimes I also had the plus 1 penalty appearing and disappearing, and I too couldn't figure out why or what was causing it :(. Opaquer 02:09, 6 November 2012 (UTC)
 * I was asking whether you'd ever combined the identical set of items (say, Sharpness 2+Fire and Sharpness 2) in the same order, and gotten two different costs. [text moved to new section]
 * Dunno how much more I'll be able to do tonight, but... weird. --Mental Mouse 02:49, 6 November 2012 (UTC)

Diamond swords
Moved from the previous section for readability:

Early experiments with diamonds are bizarre. With plain diamond swords, I'm getting 2+1/diamond for repair... but combining a damaged one with a whole one costs 17 levels, and combining two damaged swords, only 13! And it gets worse: A damaged Bane 1 sword costs 20 to repair with a whole sword, but only 16 with a damaged one. For a Bane II sword, that's 22 and 18. It also costs 18 to repair the Bane 2 sword with the Bane 1 one (both damaged). Repairing them with diamonds costs 5+2/unit and 7+2/unit respectively. (In all cases I'm assuming the unit costs are in fact constant; it was hard enough wearing my "mother sword" down below 75%.)


 * Blarg. This is getting annoying. The talk page keeps changing as I'm trying to edit it, and when I go to submit it, it deletes what I've typed :(. Third time lucky hopefully.
 * I never got different level costs from two identical enchantments. Just one of my theories that almost worked, the plus 1 penalty also kept appearing and disappearing for me, and I couldn't quite figure it out :(. For the diamond stuff, is it a total of 3 levels/diamond to repair? Also, with the bane stuff, what do you mean by 'but only 16 with a damaged one'? Do you mean that if you had a damaged bane 1 in the first slot, you put a plain whole one in the second and it cost 20 levels, but when you put a plain damaged one it only cost 16? Or were the whole and damaged ones in the second slot also enchanted with bane? Either way, the difference between bane 1 and bane 2 is only 2 levels, which is the cost of the increment of bane anyway. That's a good start. Also, the difference between using an undamaged sword and a damaged one is 4 levels, the cost of bane if it's put into the second slot. Not sure if that's true for all things though, or if it's just a constant 4 levels. I'd be willing to say that smite will have the same values here though. If you check that, try something else out: get a different enchantment, like sharpness 3 or something, and try repair it. See if adding the whole sword costs an extra 2 levels (cost of it being in the second slot) compared to a damaged sword.
 * I'm just guessing here though. With only 1 set of data, it's kinda hard to get anything for certain :P. Opaquer 03:17, 6 November 2012 (UTC)

Sorry about the changing page, I kept finding new stuff. No, repairing the plain diamond sword cost 3 for one ingots, 4 for 2 ingots, and presumably etc. That's 2 extra compared to the gold costs. Adding diamonds to the Bane swords likewise cost 2 levels more than expected. The real shocker is the sword-on-sword costs -- Even if there's a cost dependent on damage, I would not expect using a damaged sword to be cheaper. The cost for combining two damaged plain swords is 13 (12 more than expected), and using a whole sword on a damaged one mysteriously adds another 4.

Given this, the Bane repair costs are as expected:
 * Combining the Bane swords with damaged plain ones, adds the cost of the Bane swords.
 * Combining the Bane 1 sword onto the Bane 2 one costs the same as repairing the Bane 2 one with a plain sword.
 * Repairing the Bane swords with diamonds adds the cost of the Bane swords, and 1/unit for a single enchantment.

Next I think I'll try enchanting some intact swords and further damaging another "blank" sword. These experimental entries are getting long... should I perhaps be moving these experiments to my own userspace? --Mental Mouse 11:23, 6 November 2012 (UTC)
 * Hmm. Sounds like it's going quite well. What's your method of damaging the swords quickly? I might be able to join you soon, but won't have a long time to damage the swords down :(. Also, if you want to send me the data so I can have a look over it too, I would be happy to. If so, is there some way to send stuff over the wiki, or you want to talk on the forums/reddit or something? Let me know though, I love looking at data (you should see my original spreadsheet for the anvil data stuff :P). Opaquer 11:27, 6 November 2012 (UTC)


 * I'm using /gamemode to go to survival, then swinging at dirt blocks. I just started using F3+H to get durability values.  Most of my data is scrawled onto graph paper, but I can probably type it in over at my own userspace.  Newest findings:  unit repair for diamond swords costs up to 3 levels per unit, depending on the durability gained with that unit.  The third unit goes from 1 at durability 595 (up to 777 or more), to 2 around 573, and 3 around 479.  None of these are exact, I was testing at intervals while beating down the sword. --Mental Mouse 13:36, 6 November 2012 (UTC)
 * Hmm... Fair enough. So you're saying that it could be that less than 1/3 durability, it costs 3 diamonds, between 1/3 and 2/3, it costs 2 diamonds, and above that, it costs 1 diamond? --Opaquer
 * Or rather, 1/12 of the entire durability (four units, each costing up to 3 levels). I'm about to test a transition point on that.  Another note on methods:  In creative mode, you can use frames and "pick block" to duplicate a damaged weapon.  Doesn't seem to copy enchantments, though.  :-( --Mental Mouse 13:45, 6 November 2012 (UTC)
 * The pick block in frames is amazing. It's how I made so many items to enchant for the first anvil tests :P. So, at 1/12th the durability, you're saying it'll cost 12 levels to fully repair? Not quite sure if I'm getting it right :(. Kinda tired :(. Opaquer 13:48, 6 November 2012 (UTC)
 * Right, if it's worn down to a nubbin. Latest findings:  For the first ingot, the cost changes from 1 level to 2, between durability 1371 and 1361.  That's a little awkward -- it could be half-way between the twelfths (that is, rounding to the nearest twelfth). --Mental Mouse 14:08, 6 November 2012 (UTC)
 * Hmm. That's a really weird number :S. That's around 10.5/12. Maybe it's split into 24 segments, and that would relate to the 21st segment out of the 24, and every second odd one, the cost changes? 21/24 makes me happier than 10.5/12 :P. Opaquer 14:14, 6 November 2012 (UTC)
 * Yeah, that's equivalent to the rounding. But the next transition happened between 1280 and 1251, which has distinctly high for that pattern (should be 1235).  :-(  --Mental Mouse 14:34, 6 November 2012 (UTC)
 * So it is D:. Those are some odd numbers then D:? Might certainly have to do more testing, maybe with other materials too. I doubt golden swords will be split up into 24 sections too :P. Opaquer 15:04, 6 November 2012 (UTC)

I've taken my ongoing notes over to my userspace. --Mental Mouse 21:05, 6 November 2012 (UTC)

Renaming
Renamed items are exempt from increasing repair costs. I've heard it also resets the costs for items that have already been repaired. Someone might want to fit that information somewhere on the page. 173.60.208.179 02:50, 9 November 2012 (UTC)

I've done some testing on creative, and seem to have worked out the cost of renaming something. It costs 7 levels beyond the value of the item (calculated using slot 1 costs) if it hasn't been renamed before, and 10 levels above if it has. Putting it through the anvil before does not increase the cost to rename beyond the 2 it normally increases the value of the item.
 * Not so fast... check out the examples I tried at the page I link below, under "More Questions". Renaming certainly reduces the penalty, but doesn't always eliminate it.  It might halve it.... --Mental Mouse 16:33, 18 November 2012 (UTC)
 * On second look, you appear to be right. That prior experiment I pointed you at, Does Not Reproduce (I hate when that happens), and my newer work fits the pattern you note.  Also, renamed objects always have prior-repair penalty 2, regardless of later renaming or repairs.  Objects without durability do cost less to rename: 5 the first time, 9 afterwards.    --Mental Mouse 03:29, 24 November 2012 (UTC)
 * The respective paragraph still contained the phrase "renaming reduces cost". I assumed that this was missed when the article was changed before and reworded it to be more clear (and consistent). Please revert if wrong, i have not tested the facts myself. 77.6.116.145 11:12, 25 May 2013 (UTC)
 * Looks good, thanks! --Mental Mouse 00:21, 26 May 2013 (UTC)

Rewrite available
I've rewritten the page in my userspace, based on Opaquer and my recent work. It's not complete -- notably, Opaquer and I are still working on nailing down the more complex transfers of enchantments, and haven't gotten to renaming. However, we've made progress even on those, and we've nailed down ordinary repairs to both normal and enchanted items, both with units of material and with sacrifice items. ETA: And I think we've just nailed down combining enchantments, too, though we haven't completed the tests yet. Renaming still to go.

I'd like to propose replacing the current page with our rewrite, on the basis that it's already an improvement. Naturally, as we solidify our findings, we'd add them to the working page. Can I get a consensus? --Mental Mouse 16:33, 18 November 2012 (UTC)

ETA:
 * We've definitely got combining enchantments. --Mental Mouse 22:41, 19 November 2012 (UTC)
 * Dinoguy has corrected the pages' locations: Now the Anvil rewrite itself is at User:Mental_Mouse/Anvil_mechanics, and our notes and findings supporting the new info are at User_talk:Mental_Mouse/Anvil_mechanics. --Mental Mouse 14:11, 23 November 2012 (UTC)
 * And now we've got renaming, too. We can always use more examples, but I think this page is complete. --Mental Mouse 21:17, 24 November 2012 (UTC)

Installing Rewrite
OK, I'm installing the rewritten page now. --Mental Mouse 16:24, 1 December 2012 (UTC)
 * I'm back from my camps and have access to internet again! Yay! But, I just had a look at the new page. It looks good :D! Opaquer 00:57, 4 December 2012 (UTC)
 * Thanks! Working on this has been very much a team thing, exactly how wikis are supposed to work.  --Mental Mouse 23:36, 5 December 2012 (UTC)
 * Then we make a good team :P! We started from nothing and now know just about everything to do with anvils, all ourselves! Go us :P! Opaquer 00:46, 6 December 2012 (UTC)

Enchanted books incoming...
I don't follow snapshots, so I can't test them yet. My bet is they'll be the simplest possible implementation, acting like a sacrifice with no durability. There might be a surcharge for using a book, through. Item/enchantment compatibility (Unbreaking Armour, anyone?) could be interesting, but most likely the anvil just rejects anything inappropriate. --Mental Mouse 14:02, 8 December 2012 (UTC)


 * I've heard about them, but haven't seen or read anything else about them. Shall be interesting to hear about them though if I'm around (I've got between 4-8 camps I'm going on between now and the end of January! Busy me!) Still though, I'll be around every so often and read the stuff here :D. Opaquer 14:04, 8 December 2012 (UTC)
 * And... the anvil may not reject inappropriate items! The forum thread has mention of a stack of Efficiency 4 fish, and someone else raised the spectre of Sharpness 5 bread (no durability!).  Of course, the latter exploit would also depend on the code actually processing the enchantment when you swing it, instead of "not a weapon? bare hands, finis". --Mental Mouse 14:39, 8 December 2012 (UTC)
 * Oh cool! So you can make legit battle signs now :D! I'd still stick to a sword for that little bit of extra damage, but no durability sounds amazing! Opaquer 14:40, 8 December 2012 (UTC)
 * Hmm. Dinnerbone knows about it and says "please don't exploit it too much".  Meanwhile, the forums are squeeing over collecting Cobwebs with Silk Touch shears.  And yeah, it sounds like they are processed.  I suspect most of the wrong-item enchants will be fixed, but I hope we do keep a few of them. --Mental Mouse 15:23, 8 December 2012 (UTC)

Aack, they did change anvil costs in the new version....
Enchanting costs for books are not following the pattern -- often cheaper -- and early experiments indicate it's not just books, the costs in general have changed: frequently less, but there's weirdness in the patterns. I'm not going to have time to nail this down just now, I might be able to do experiments over the weekend. --Mental Mouse 12:39, 4 January 2013 (UTC)
 * Starting experiments, working notes at User talk:Mental Mouse/Book mechanics. So far, the straight repairs and simple item combinations I've tried match the current tables.  Books... that's another story.  Looking very mysterious. --Mental Mouse 03:19, 5 January 2013 (UTC)

From looking at the code (1.5.1), here's what I've been able to work out:

The anvil calculates cost in two parts:

- a "repair" cost, consisting of the repair cost, any cost for incompatible enchantments, the basic renaming cost (7 for items with durability, 5 otherwise), and approximately half the cost of any new enchantments (specifically, just the cost-per-level * the number of new levels for any new enchantment levels)

- and an "extra" cost, consisting of the base enchantment cost, the prior repair penalty, a re-renaming penalty of half the basic renaming cost (rounded down), and the remaining half of the cost for any new enchantment levels (including the X*(T-1) + 1 addition).

If the sacrificed item is an enchanted book, two changes happen: the cost-per-level of all enchantments, both existing and new, is halved (rounding down, with a minimum of 1), and the complete "extra" cost is halved (rounding down). So for using enchanted books, the base cost of the item is at least halved--more if the prior work penalty is low, and the additional cost of the new enchantment level(s) is reduced by roughly 5/8 (less for Protection, Sharpness, Efficiency, and Power). --173.167.14.225 16:15, 22 March 2013 (UTC)


 * Thank you! It looks like the costs are internally grouped very differently than they look -- I may rewrite the article to match, just so I can explain that for books.  So, the "base enchantment cost" is the same as the "base value"?  And even that gets calculated differently for books?  Pretty hacky for what was supposed to be the "original purpose of the anvil".  Let's see if I've got this straight:  A Smite 4 sword would normally have BV 8+1, but against a book it would have 4+1?  But would a Sharpness 4 sword be 2+1, or would the minimum make it still 4+1? --Mental Mouse 12:08, 23 March 2013 (UTC)
 * Comparing to my Efficiency tests, it looks like the level cost is minimum 1 per level, including for the "extra cost", but the extra cost gets halved again (after adding the base value and X*(T-1)+1), and can round down to 0.  --Mental Mouse 14:58, 23 March 2013 (UTC)
 * And a new question, which I might be able to test later: When combining an enchantment max-on-max (with something else to keep the anvil from rejecting it), you still pay one level's cost, but presumably only in one of the two phases.  The question is, which one.... --Mental Mouse 16:34, 23 March 2013 (UTC)
 * Answer: the extra phase, but the penalty does not get halved for a book (except as part of the "extra costs" halving). (This may be a bug.)  That is, combining a Fortune 3 pick with a Fortune 3 book (the cost is entirely in "extra"):   base cost is 7 (1+3&times;(4&divide;2)), but then pay 4 to make 11 for the extra costs, and a total cost of 5.  If the double-max cost were halved, that would be 4.  Unbreaking follows the same pattern, with a similar "tell". --Mental Mouse 18:02, 23 March 2013 (UTC)

Optimal Use
Can anyone tell me the optimal use of it, generally? Is it best to combine tools together or to always use raw materials? Should I avoid using it altogether except to enchant specific enchantments? 70.35.98.102 07:11, 21 January 2013 (UTC)

Items fail to repair
There's a bug in SMP where if you repair an item, the repaired item shortly (after about two seconds) reverts back to its unrepaired state and materials but your Experience is still used up. Has anyone else noticed? 72.199.200.174 22:49, 12 March 2013 (UTC)

please confirm: the 'bug' is fixed in 1.5
The bug section looks like, and is fixed in 13w16a/1.5.2. Does anyone confirm this? I don't play multiplayer... --AMotohiko 04:59, 21 May 2013 (UTC)

Exactly when does it say "Too Expensive"?
I've been searching around and I just can't find any information that explains exactly when the anvil says "Too Expensive". Some people have told me the cap is level 50, but I've done a 56 XP level repair before. If it was mentioned in this article then it's not very clear or obvious, because I read the page three times and didn't find it. Does anyone know?  LB ( T 18:52, 26 June 2013 (UTC)