Minecraft wiki entry for Trading, associated text: Villagers distinguish between data values, so damaged tools cannot be traded in place of fully repaired tools.‌[Bedrock Edition only] NBT data, however, is ignored, so the content of a written book does not matter. However, written books can no longer be sold to villagers, and no villagers currently buy any tools that have durability.