The roof is a structure that protects players from being exposed under the sun. It was added in the Sun and Moon update. Players can place it over anything, except on other roofs. Standing under it will slow down the rate at which players lose cold. Only the player and teammates can see under the roof, unless you are very close to the roof. Garland can be placed on the roof for decorating. Roofs are vital for vampires in the Vampire Mode, as they need protection from the sun at day. Vampires start out with 4 roofs when they spawn, which they can use to protect themselves from the harmful sunlight. It takes 10 seconds to craft a roof. This action can be speed up when using an IKEA Manual.
Another thing to note about a roof is that if you have earmuffs, hood, or a peasants tunic you can afk without your heat bar going up or your cold bar dropping. If you need to afk and you have one of those 3 hats, go in a lake or into the ocean, place a few bridges, as well as some walls and a door or two, and then put a roof where you will be afking. You will be perfectly fine as long as you are under the roof and have enough food, unless obviously someone or an animal kills you.