Minecraft wiki entry for Tips_and_tricks, associated text: If you have discovered a structure that could yield you many items, such as a mineshaft, a stronghold, or a swamp hut, you may be tempted by the riches. However, don't attempt to enter right away, as you may lose any valuables and may not be able to reach them in time. To prevent this from happening, set up a new spawn point at the outskirts of the discovered structure by placing a bed and sleeping in it. Carry a bed at all times when exploring far away from home. This will also let you skip past dangerous nights and storms, rather than fighting or hiding for the duration.