You don't need to sleep, and magic can't put you to sleep. You can finish a Long Rest in 4 hours if you spend those hours in a trancelike meditation, during which you retain consciousness.
Trance
Raw data
{
"srd": false,
"name": "Trance",
"page": 189,
"type": "entries",
"__prop": "raceFeature",
"source": "XPHB",
"entries": [
"You don't need to sleep, and magic can't put you to sleep. You can finish a {@variantrule Long Rest|XPHB} in 4 hours if you spend those hours in a trancelike meditation, during which you retain consciousness."
],
"raceName": "Elf",
"basicRules": false,
"raceSource": "XPHB"
}