Mods / Local Respawn

Tags:
Other QoL Tweak
Author:
DoodleGarbage
Side:
Server
Created:
Sep 8th 2024 at 11:02 PM
Last modified:
May 21st at 7:06 AM
Downloads:
6879
Latest release (for Vintage Story 1.22.0-pre.1 - 1.22.2, potentially outdated):
localrespawn_2.0.1.zip  1-click install

Many people hate dying in this game. You explore far, locate that precious bauxite you need for a steel and then- you die! You must now travel 10,000 blocks, just because you were unlucky and the bauxite was far away.

No more! With this mod, this distance you need to travel will be consistent. No matter where you are in the world, you can decide how long it'll take to travel back to your body! Decide how punishing you want death to be!

 

When you die, you'll spawn within a fixed radius around you. You can configure the size and distance of that area using the configuration. When you respawn, you'll only need to walk a consistent number of blocks to reach your dead body. How easy or extreme you want this to be is easily configurable.

 

Due to how this mod works, some things to keep in mind:
Temporal Gears will no longer cause you to respawn at the location that you used them when you use one to set your spawn point.  However, if you set your spawn point using a Temporal Gear, the Base Return Teleporter will return to that point.

- Warning: Quitting and not respawning before the server restarts (such as when you Rage Quit) will replace your spawn point set by temporal gear.

Possible Bugs:

  • Spawning Underground; If this happens to you, please provide information on the circumstances surrounding it here. Information such as weird chunk behavior, number of players on the server, and any strange movement before/after is useful.

Configuration

This mod is easily configured. After loading a world the first time, a configuration file will be created (this file is server-side).

  • MinDistance: The minimum radius from the death point that players will respawn at. Set this greater than or equal to the MaxDistance to always spawn at the furthest distance.
  • MaxDistance: The furthest from the death point that players will respawn at.
  • PlayerList: A list of player usernames that are whitelisted/blacklisted from being affected by this mod.
  • IsWhitelist: Whether or not the PlayerList is a whitelist or a blacklist.

Mod Version Mod IdentifierFor Game version Downloads Released Changelog Download 1-click mod install*
2.0.1 localrespawn
1.22.0-pre.1 - 1.22.2
678 May 21st at 7:06 AM localrespawn_2.0.1.zip 1-click install

Fixes entity pos error for 1.22

Big thanks to Tyeia for fixing this

2.0.0 localrespawn 1413 Nov 20th 2025 at 7:53 AM localrespawn_2.0.0.zip 1-click install

Added Configuration! The config file will generate after launching the world once.
Config Options:

  • MinDistance: The minimum radius from the death point that players will respawn at. Set this greater than or equal to the MaxDistance to always spawn at the edge.
  • MaxDistance: The furthest from the death point that players will respawn at.
  • PlayerList: A list of player usernames that are whitelisted/blacklisted from being affected by this mod.
  • IsWhitelist: Whether or not the PlayerList is a whitelist or a blacklist.

Other Changes:

  • Changed internal method of generating respawn points. The points are now evenly distributed throughout the valid respawn area.
  • Respawning is no longer dependent on the world respawn radius (It depends on the config; see above). This means you could set your world respawn radius to 0 so everyone starts at Spawn or have a large radius to spawn everyone far away initially.
1.2.4 localrespawn 41 Nov 20th 2025 at 5:55 AM localrespawn_1.2.4.zip 1-click install

Minor refactor to some respawn code; may or may not affect bugs

Recompiled in .net8; shouldn't cause any incompatabilities

1.2.3 localrespawn
1.20.2 - 1.20.3 1.20.5 - 1.20.7
1168 Apr 19th 2025 at 8:27 PM localrespawn_1.2.3.zip 1-click install

Fixed: Spawn-in-ground bug.

  • Notes: Cleaned up some code that looked like it was interfering with the un-stuck code. Tested to work ~99% of the time, with and without other mods.


Fixed: Added back the mod icon, oops.

1.2.2 localrespawn
1.20.0 - 1.20.3 1.20.5 - 1.20.7
253 Apr 16th 2025 at 5:12 PM localrespawn_1.2.2.zip 1-click install

Finally, finally, put together something that looks to fix the nefarious spawn-in-ground bug. It works just by teleporting you to the surface after you respawn on chunk-load. This may have an edge case where walking into your spawn location and triggering a chunk load will teleport you to the surface.

If it breaks lmk because I have no promises.

1.1.0 localrespawn 852 Jan 29th 2025 at 11:22 PM localrespawn_1.1.0.zip 1-click install

Should fix the accursed spawn-in-ground bug. (had a faulty line of code)

While labeled only for v1.20.3 (the only version I tested), this mod may work in any version. (No promises, but it should work on most versions)

1.0.7 localrespawns
1.19.8 - 1.20.0-pre.0
790 Sep 20th 2024 at 5:33 AM localrespawns_1.0.7.zip 1-click install

Apologies.
Fixed "world height compatability" change, respawning shouldn't spawn in rocks, up to world heights of 1568. (even then, that'd have to be a world-height mountain)
Added new feature: If you die, and are within the Spawn Radius distance to your spawn location set with a Temporal Gear, you will respawn at your Temporal Gear spawn point.

1.0.6 localrespawns
1.19.8 - 1.20.0-pre.0
252 Sep 19th 2024 at 11:55 PM localrespawns_1.0.6.zip 1-click install

Fix: So I was using CakeBuild wrong...
Any future releases should use the correct files now!
Sorry to anyone who's downloaded my bugged af versions
I never knew a simple mod could be so complicated

1.0.5 localrespawns
1.19.8 - 1.20.0-pre.0
275 Sep 19th 2024 at 9:54 PM LocalRespawns_v1.0.5.zip 1-click install

- Fix: Spawning inside of blocks
- Fix: No longer limited by world height

1.0.4 localrespawns 302 Sep 15th 2024 at 3:04 AM LocalRespawns_v1.0.4.zip 1-click install

Looks like I packaged the wrong .dll with version 1.0.2. That's been fixed (whoopsies)

1.0.2 localrespawns 296 Sep 11th 2024 at 12:18 AM LocalRespawns_v1.0.2.zip 1-click install
  • Base Return Teleporters will now work when you set your spawn point with a temporal gear. This should also improve compatabillity with other mods that use your spawn point.
  • (May delete your spawn point if you rage quit without respawning)
1.0.1 localrespawns 282 Sep 9th 2024 at 12:04 AM LocalRespawns_v1.0.1.zip 1-click install

Presumably fixed bug where temporal gear spawns still worked (thus preventing this mod from functioning)

1.0.0 localrespawns 277 Sep 8th 2024 at 11:23 PM LocalRespawns_v1.0.0.zip 1-click install

First Release

- Spawns you at a random point within a radius (Spawn Radius) around your point of death.


39 Comments (oldest first | newest first) (threaded | flat)

Tyeia, May 21st at 2:10 AM

I have opened a PR with the code changes needed to update this mod to 1.22. Please look it over when you can.

Luceo, May 8th at 12:15 AM

Any chance this will be updated for 1.22?

SparrowOfRealms, Nov 26th 2025 at 3:37 AM

Very awesome mod to have, hated having to be paranoid and use a temporal gear every 5-10k blocks in fear of an accident when being chased down by modded allosauruses and other terrible terrors

DoodleGarbage , Nov 21st 2025 at 2:29 AM

SparrowOfRealms Yes, you can add and remove this mod from existing worlds. When removing it you might run into an issue with player spawn points being incorrect, but you can fix this by using a temporal gear to set a new spawn point.

SparrowOfRealms, Nov 20th 2025 at 10:35 AM

Can this mod be safely added and removed to an existing world?

 

DoodleGarbage , Nov 20th 2025 at 7:50 AM

New features! I've added configuration. You can now set the respawn radius independently of the world respawn radius! You can additionally whitelist/blacklist players to be affected by this mod.

See the changelog for details.

DoodleGarbage , Nov 20th 2025 at 5:54 AM

Hello everyone! I've returned from the dead. The mod runs just fine in the latest version of Vintage Story (1.21.5). I've recompiled it using .net8 but I don't think that'll change anything about how the mod behaves or functions.

 

Rader Thank you for looking through the code! I couldn't guess what my thought process behind the to_delete loop was lol. I've edited that to not be so prone to off-by-one errors and should be more tolerant to simultaneous changes.

 

I'm unfamiliar with how the mod behaves in a multiplayer setting, because I can't test it, but I suspect that the issues with spawning the ground are probably related to that. From my testing with the mod, I've been unable to trigger an underground spawn. The closest I've gotten is with large respawn values, but will always be teleported up. There could be an interaction with multiplayer here that I can't test/some sort of race condition in the code. It's possible that the code refactor I made could've fixed this; will require time to see.

To anyone who plays with the latest version on a multiplayer server ( Vigilance, Keltskiy, ) and spawns underground, please send me the respawn radius, number of players playing, and any strange circumstances around your death/respawn at the time of death.

Finwe, Oct 27th 2025 at 7:32 PM

I tested and it works in 1.21. Still hoping for the mod to continue getting future updates.

Louky, Oct 9th 2025 at 5:36 AM

Does this work in 1.21.1?

Keltskiy, Sep 14th 2025 at 9:26 AM

Really been wanting something like this for a private server.
Does this mod still work or do I need to wait till someone releases a newer version?

 

Rader, Jul 27th 2025 at 9:10 PM

This is just the mod I was looking for. I was just looking through the code for it.
The lastSpawnLocations.RemoveAt(i); deletion loop does not seem to delete the correct things in the list. (it should use the value in the toDelete list but here we are just using the index)

Also there might be a memory leak is the player respawns and onChunkLoaded is not called, as lastSpawnLocations would infinitely grow. 
Are the events onChunkLoaded and OnPlayerDeath called on different threads? if so we could have a multithread collision on our lastSpawnLocation list. A mutex or the like might be in order.

 

I have been searching for a mod like this, so if you want a helping hand, dont hesitate to ask (Although I have no modding knowledge for VS, just software development)

Vigilance, Apr 30th 2025 at 2:36 PM

Some of my friends are still reporting the spawn-in-the-ground bug. Anything useful I could try to collect as far as debug goes? I haven't personally experienced it, but I'm also allergic to death. 

DoodleGarbage , Apr 19th 2025 at 8:28 PM

Update: Cleaned up some errenous code I left in. After respawning a hundred times with and without mods, I spawned above ground ~99% of the time. Sometimes spawned halfway in a block, especially if respawning in water. But otherwise, was not stuck.

florins, Apr 18th 2025 at 7:54 AM

Awesome DoodleGarbage

DoodleGarbage , Apr 16th 2025 at 5:22 PM

Update Update: It looks like I got something slapped together that fixes the spawn-in-ground bug! Enoy!

DoodleGarbage , Apr 15th 2025 at 1:36 AM

Update: Still have no clue how to prevent spawning inside rock.

I implemented a teleport that triggers on player respawn to put you on the surface, but it does not prevent spawning underground.

I have however confirmed the issue: My code to spawn the player cannot find the surface block (likely due to nothing being there), and thus spawns you at the same y-level you were previously at as a fall back.

I will continue to work to figure out if I can determine a fix.

DoodleGarbage , Apr 14th 2025 at 8:08 PM

florins You're probably right with that guess. There's another bug report about the game bricking when spawning in an bugged unloaded chunk, which suggests that world gen coould be a factor.

Doesn't 100% confirm it, I wouldn't know why you'd not spawn at the bottom of the world (should check if it's spawning at the same y as where you died?)

The code to set your respawn point runs when the "on death" event triggers, so the world won't generate before it gets set. The code uses the World.BlockAccessor.GetBlock function, which I do not know how it interacts with unloaded chunks nor do I know if there's any alternative function that will work.

Maybe I can instead write some code that will teleport you to the surface "on revive" - this might do the trick.

florins, Apr 9th 2025 at 4:11 AM

The bug might be because player spawns before the world tile is generated?

 

I notice if I set 500 spawn radius, I can spawn right at the edge of the currently generated map, and my computer takes another 2 seconds to generate the world right in front of me.

 

Maybe at 5000 spawn radius we spawn so far away from last location that the world hasn't generated yet but your code to land on the ground runs too early?

 

DoodleGarbage

florins, Apr 8th 2025 at 7:46 AM

DoodleGarbage I've "fixed" it by setting a 250 spawn radius. Haven't spawned in the ground yet with that setting.

DoodleGarbage , Apr 7th 2025 at 5:49 PM

florins I can confirm that spawning in the ground does happen. To be honest, I have no clue why. The current code should detect the top most block and thusly spawn you there, but it doesn't always seem to do this. Not really sure what the issue with the code is.

florins, Apr 7th 2025 at 7:41 AM

I'm spawning in the ground or the ocean quite often.

Settings: Wilderness Survival (meaning 5000 spawn radius) and I'm using 60% land cover (so 40% oceans)

DoodleGarbage , Jan 29th 2025 at 11:24 PM

Hey everyone! I have returned from the graveyard of ghosts. I've pushed a new release that should fix the spawning in ground bug, along with updated the github repository with the up-to-date source code.

If you still spawn in the ground, let me know. The code should start at y=3000 and then fall down until it finds a non-air block, where it spawns you 1 block above.

rayray, Dec 1st 2024 at 2:19 AM
CoolBee, Nov 30th 2024 at 9:14 PM

this is for 1.19.8

 

for anyone having probelms with dying and being spawned inside of a rock, a easy way to reduce the issue is to run the comand

"/worldconfig spawnradius 10". 

this wont remove the problem, but it will reduce it.

suggestions for dev:

here are two ideas I have for removing the problem. 

  1. check spawn position for air blocks, and if there are not air blocks, check to see if there is already a block there. then loop that function until it finds a location. it should find a location in time for small radius spawns.
  2. save the players position the last time they touched grass blocks(every few seconds for preformance) they spawn only on the surface and use that for the players spawn point data. this would make it so if a player died in a cave they would spawn on the surface just outside the cave. this isnt perfect because if a grass block is inside the cave and the player touches it it would still spawn you inside of a rock. 

the best thing i can think to do is to do a combination of the both of these. by checking the players last grass interaction location with the function loop to find the spawn location that doesnt have blocks inside of it or has air blocks. 

 

 

rayray, Nov 30th 2024 at 12:25 AM

i always spawn in a rock and have to use admin kill 9/10 spawn until i final land above ground

 

Mackeroni, Oct 22nd 2024 at 3:05 PM

This is how I thought the respawn distance worked when I first played. Really glad to see this mod existing.

DoodleGarbage , Sep 26th 2024 at 6:21 AM

Phoenicius

Yes, that is correct.

WickedSchnitzel

Good point. I'll implement that the next time I work on this mod.

Phoenicius, Sep 24th 2024 at 5:16 PM

Thanks for letting me know. Also, just to make sure I'm understanding correctly, the spawnRadius value in serverconfig.json controls how far away you'll respawn from your death point? So if I set it to 100, then if I die, I should respawn within a 100 block radius of where I died?

DoodleGarbage

WickedSchnitzel, Sep 21st 2024 at 9:50 PM

So if the spawn radius is 0 (like on servers people are spawning at the same place, near the info boards etc), we cannot use that mod, right? This should have it's own spawn radius.

DoodleGarbage , Sep 20th 2024 at 5:34 AM

Phoenicius

Sorry for the shoddy work, but I've released a new version that actually implements compatability with higher world heights, fixed a nasty bug the old fix introduced, and as a bonus added a new feature.

DoodleGarbage , Sep 20th 2024 at 5:26 AM

And so my knowledge expands. The bugs in this code are just 💀

Oh no the "world height compatability" change now means you respawn on the same y as you died

fixing immediately

Phoenicius, Sep 20th 2024 at 2:14 AM

Awesome! Downloading now.

DoodleGarbage , Sep 19th 2024 at 9:58 PM

Phoenicius

Wait no longer! I've offload internal work to game code and now spawning should both work worlds of any height and no longer throw you inside (or very high above) the ground!

Phoenicius, Sep 15th 2024 at 3:20 PM

Following your mod in the hopes that you'll eventuallly be able to make it work with world heights bigger than 256

DoodleGarbage , Sep 15th 2024 at 3:06 AM

Robik

Thanks for letting me know. Also ran into this on my end, looks like I made a mistake when publishing the version. It should be fixed now, thank you for the help!

Robik, Sep 12th 2024 at 1:02 PM

Does not seem to work. I died several thousands blocks from my spawn and I still respawned very near my spawn point where my base also is. Happened twice, so I don't think it was unlucky coincidence.

DoodleGarbage , Sep 11th 2024 at 12:25 AM

Hexis

Hey, I've released an update that makes the use of Base Return Teleporters possible. Thanks for bringing this issue to my attention!

DoodleGarbage , Sep 10th 2024 at 3:48 AM

Hexis

Thanks for pointing that out. I'll have to think about how to account for that (and other items, modded or otherwise, that use your respawn point). I do have an idea of how I could get that to work.

Hexis, Sep 9th 2024 at 2:33 PM

What a clever idea! 
quick edit to add, though, what about the use of base return teleporters? if your base is at spawn, and the biome youre in is many MANY thousands of blocks away... you have to walk back home if you cant set a temporal gear spawnpoint.