Minecraft wiki entry for Villager, associated text: In Java Edition, dropping any anvil on a villager that is sleeping causes the anvil to bounce and drop as an item, and the villager remains sleeping and does not take damage.