the villager takes damage and wakes up.
In Java Edition
and the villager remains sleeping and does not take damage.
A villager who has no bed continues wandering in search of a bed to claim.
Villagers follow their Overworld schedules regardless of which dimension they are in. They can sleep in the Nether or the End
even though it is not normally apparent to the player.
A villager may occasionally turn their body so that their head is on the bed’s pillow when entering a bed from another direction. Villagers also sleep with their eyes open.
without causing the usual consequences of the bed exploding (See Bed)
if the Overworlds time is correct.[6] This is because the daylight cycle continues in these dimensions
just like players.
When villagers advance in their profession, they experience a momentary regeneration effect. Pink regeneration particles appear when the villager is healing.
In Bedrock Edition