Minecraft wiki entry for Villager, associated text: When sleeping in Bedrock Edition, a villager's hitbox reduces to a cube restricted to the pillow part of the bed. If an anvil is dropped on the hitbox, the villager takes damage and wakes up.