Minecraft wiki entry for Things_not_to_do, associated text: Try not to over-enchant tools and weapons, as over-enchanting them increases the risk of not being able to repair them. This is because the anvil has a limit of 39 levels for a task, so even if the player has enough levels, the anvil still declares the repair work "too expensive" if the task costs more than the anvil's limit. The player can avoid increasing anvil costs by not renaming items early on, or combining other items and enchanted books with the item. The player can circumvent issues with high anvil costs by enchanting tools with the Mending enchantment, removing the need to repair these tools using an anvil. If a player does not have access to mending books, they could also enchant items with Unbreaking to increase the time between needing to repair items in an anvil.