SANDBOX — this is a test environment. No servers are actually deployed and no real payments are charged.
Source-checkedQuality of life & UI

Spawn In Bed

by YangWenLi · for Vintage Story

Re-spawn in any bed you've slept in. Emotional support drifter plushy not included.

14KDownloads
1.22.2Latest game version
Vintage Story ModDBSource

About Spawn In Bed

From Vintage Story ModDB

Re-spawn in any bed you've slept in. Emotional support drifter plushy not included.

Sleeping in a bed sets your spawn point to it. Just that. Works with modded beds!
Made because the usual mods for this aren't working on the latest version, so I took it upon myself to make my own implementation.

 

Source Code (Sorry, too lazy to put this on github lol)
<pre class="language-csharp">using System; using System.Collections.Generic; using Vintagestory.API.Common; using Vintagestory.API.Common.Entities; using Vintagestory.API.Datastructures; using Vintagestory.API.Server;

namespace YangBed { public sealed class YangBedModSystem : ModSystem { private ICoreServerAPI sapi; private readonly Dictionary&lt;string, Action&gt; mountListenersByPlayerUid = new Dictionary&lt;string, Action&gt;();

public override bool ShouldLoad(EnumAppSide forSide) { return forSide == EnumAppSide.Server; }

public override void StartServerSide(ICoreServerAPI api) { sapi = api;

sapi.Event.PlayerNowPlaying += OnPlayerNowPlaying; sapi.Event.PlayerDisconnect += OnPlayerDisconnect; }

private void OnPlayerNowPlaying(IServerPlayer player) { if (player == null || player.Entity == null) return;

UnregisterPlayer(player); string playerUid = player.PlayerUID;

// Beds set tiredness.isSleeping via an enqueued task during mount, one-shot callback. No need to check anything each tick or something stupid like that. Action listener = () =&gt; { sapi.Event.RegisterCallback(_ =&gt; TrySetSpawnFromSleep(playerUid), 50); };

mountListenersByPlayerUid[playerUid] = listener; player.Entity.WatchedAttributes.RegisterModifiedListener("mountedOn", listener); }

private void OnPlayerDisconnect(IServerPlayer player) { if (player == null) return; UnregisterPlayer(player); }

private void UnregisterPlayer(IServerPlayer player) { if (!mountListenersByPlayerUid.TryGetValue(player.PlayerUID, out Action listener)) return;

player.Entity?.WatchedAttributes.UnregisterListener(listener); mountListenersByPlayerUid.Remove(player.PlayerUID); }

private void TrySetSpawnFromSleep(string playerUid) { IServerPlayer player = sapi.World.PlayerByUid(playerUid) as IServerPlayer; if (player == null || player.Entity == null) return;

EntityPlayer entity = player.Entity; if (entity.MountedOn == null || !IsSleeping(entity)) return;

EntityPos seatPos = entity.MountedOn.SeatPosition ?? entity.Pos; player.SetSpawnPosition(new PlayerSpawnPos { x = (int)Math.Floor(seatPos.X), y = (int)Math.Ceiling(seatPos.InternalY), z = (int)Math.Floor(seatPos.Z), yaw = seatPos.Yaw, pitch = 0f, roll = 0f, RemainingUses = -1 });

player.SendIngameError("yangbed-confirm", "Re-spawn Point Set..."); }

private static bool IsSleeping(EntityPlayer entity) { ITreeAttribute tiredness = entity.WatchedAttributes.GetTreeAttribute("tiredness"); return tiredness != null &amp;&amp; tiredness.GetInt("isSleeping") &gt; 0; }

public override void Dispose() { if (sapi != null) { sapi.Event.PlayerNowPlaying -= OnPlayerNowPlaying; sapi.Event.PlayerDisconnect -= OnPlayerDisconnect; foreach (IPlayer player in sapi.World.AllOnlinePlayers) { if (player is IServerPlayer serverPlayer) { UnregisterPlayer(serverPlayer); } } }

mountListenersByPlayerUid.Clear(); base.Dispose(); } } }</pre>

&nbsp;

Highlights

From source data

Game versions

Supports 3 Vintage Story versions, the newest being 1.22.2.

Footprint

Rated a light load on a server.

Spawn In Bed on Nxeon

From our catalogue
One-click install
Supported on Nxeon Vintage Story servers. We download it from Vintage Story ModDB, place it, and restart the server.
Server side
Required on the server
Server load
light
Smallest plan we suggest
Vintage Story — 1 GB (1 GB RAM). This follows our own load rating above, not a benchmark.

Run Spawn In Bed on a Vintage Story server

Pick a server or deploy a new one above; it is installed in one click.

What kind of mod it is

From the catalog
Listed on Vintage Story ModDB as “QoL”

Quality of life & UI

Small conveniences, tweaks and interface improvements players notice straight away.

Runs on your server

From source side support

Vintage Story ModDB lists Spawn In Bed as required on the server. Check its Vintage Story ModDB page to see whether players need it too.

Compatibility

Game
Vintage Story
Runs on
Serverrequired on the server
Game versions
1.22.2 and 2 earlier

Verified at the source

  • ✓Vintage Story ModDBOfficial listing, checked 2026-09-24Open ↗
  • ✓AuthorYangWenLi, as published on Vintage Story ModDB
  • ✓LicenseNot published by the sourceFree

Spawn In Bed, answered

Generated from the mod’s own source data.

Do my players need to install Spawn In Bed?

Vintage Story ModDB lists Spawn In Bed as required on the server. Check its Vintage Story ModDB page to see whether players need it too.

Is it free?

Yes. Spawn In Bed is free to download from Vintage Story ModDB.

How do I add it to my Nxeon server?

Use “Add to a server” on this page, or open NxLabs from your dashboard. We install it, restart your server and switch it on.

NxLabs

Run Spawn In Bed on a Vintage Story server.

Deploy in about a minute from $4.00 a month, then add Spawn In Bed in one click.