public override void OnEntityRevive() { // be extra super careful to avoid crashes, even though this should never happen due to business logic if (this.entity.World.Side != EnumAppSide.Server || !(this.entity is EntityPlayer)) { this.entity.World.Api.Logger.Debug("ClearSpawnPosAfterReviveEntityBehavior: unexpected: client side or entity not player, skipping"); return; } // get IServerPlayer from Entity per https://github.com/anegostudios/vssurvivalmod/blob/master/Item/ItemTemporalGear.cs#L182 IServerPlayer plr = this.entity.World.PlayerByUid((this.entity as EntityPlayer).PlayerUID) as IServerPlayer; this.entity.World.Api.Logger.Event("ClearSpawnPosAfterReviveEntityBehavior: clearing player's spawn position (whether or not it was set)"); plr.ClearSpawnPosition(); }