Sleeping Bag Mechanics
The Sleeping Bag Mod functions by hooking into the vanilla sleep cycle while bypassing the spawn-setting code.
Portable Sleeping
To use a sleeping bag, it must be placed on a flat surface. Right-clicking the placed bag at night or during a thunderstorm will cause the player to enter the sleeping state. Upon waking, the time will be set to morning, and the weather will clear, just like a standard bed.
Spawn Point Preservation
This is the core mechanic of the mod. When a player wakes up from a Sleeping Bag, the game does not update the player's spawnPoint NBT tag. This means if the player dies later, they will return to their last actual Bed or the world spawn, rather than the location where they last camped.
Portability and Recovery
Unlike beds, which are often left behind, sleeping bags are designed to be broken and moved. They have very low hardness and can be broken instantly by hand. When broken, the sleeping bag drops itself as an item, ready to be placed again at the next campsite.
Dimensional Behavior
Following vanilla logic, attempting to use a Sleeping Bag in the Nether or The End will result in an explosion. It is strictly intended for use in the Overworld or other stable dimensions that support sleeping mechanics.