Minecraft wiki entry for Anvil_mechanics, associated text: Every time an item has been used in an anvil, it gets one anvil use. If the player adds an enchanted book that had never been used in an anvil with a sword that had never been used in an anvil, then the sword gains 1 anvil use.