Some of the c# stuff I was messing about with using the built in API worked in SP, but that was before it went stable, so I don't know if they changed something. Some mods were required client side and server side to work.
namespace StayClear
{
[HarmonyLib.HarmonyPatch(typeof(SleeperVolume))]
[HarmonyLib.HarmonyPatch("UpdatePlayerTouched")]
public class StayClear_SleeperVolume_UpdatePlayerTouched
{
static bool Prefix(ref ulong ___respawnTime, World _world)
{
___respawnTime = _world.worldTime + 120000UL;
return true;
}
}
public class StayClear : IModApi
{
void IModApi.InitMod(Mod _modInstance)
{
var harmony = new HarmonyLib.Harmony("io.stealthbit.7dtdmods.StayClear");
harmony.PatchAll();
}
}
}
Something like that should work after adding the relevant dll references. (Untested)