OnRespawnInformationGiven
OnRespawnInformationGiven is called from BasePlayer.SendRespawnOptions right after the player's respawn options are collected and just before the list is sent to the client. It lets you filter or alter the spawn menu for that player.
void OnRespawnInformationGiven(BasePlayer player, List<ProtoBuf.RespawnInformation.SpawnOptions> list)Parameters
| Parameter | Type | Description |
|---|---|---|
player | BasePlayer | The BasePlayer being sent respawn options, usually one who just connected or is waiting on the death screen. The options list belongs to this player only. |
list | List<ProtoBuf.RespawnInformation.SpawnOptions> | The List of ProtoBuf.RespawnInformation.SpawnOptions that will be serialized and sent to the client as the respawn menu. Modify it in place: remove entries to hide spawn choices, change fields to relabel them, or leave it untouched. |
Return value
The hook is patched with plain continue behavior into a void method, so whatever you return is ignored. SendToPlayer runs regardless; the only way to influence the respawn menu is to mutate the list object in place.
How it works
This hook fires inside BasePlayer.SendRespawnOptions, after GetRespawnOptionsForPlayer fills the list and before SendToPlayer serializes it to the client. It runs for a single player whenever the server prepares that player's respawn screen: on initial connection while the client waits for the world, and after death when the player requests respawn options. The player argument is the recipient of the list; list holds the ProtoBuf.RespawnInformation.SpawnOptions entries (sleeping bags, beds, and similar points) the client will display.
Because the list is passed by reference and the method returns void, editing list in place is what changes the outcome. Removing entries hides spawn points; adjusting option fields changes what the client shows. Reading the list without changing it is safe. There is no separate per-option hook here, so filtering by owner, team, or distance must be done by inspecting each option (for example its name and id) and dropping it.
Declaring player as BasePlayer matches the game's argument exactly. There is a second path in the decompiled code (CollectExternalAndSend) that builds options asynchronously; this hook only covers the direct path shown, so treat filtering as best-effort on the synchronous send.
Example plugin: Limit respawn options per player
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Oxide.Core;
using ProtoBuf;
namespace Oxide.Plugins
{
[Info("Respawn Option Limiter", "RustPluginGenerator", "1.0.0")]
[Description("Caps the number of spawn options shown to a player on the respawn screen.")]
public class RespawnOptionLimiter : RustPlugin
{
private const string PermUnlimited = "respawnoptionlimiter.unlimited";
private PluginConfig config;
private class PluginConfig
{
[JsonProperty("Max spawn options")]
public int MaxOptions { get; set; } = 8;
}
protected override void LoadDefaultConfig() => config = new PluginConfig();
protected override void LoadConfig()
{
base.LoadConfig();
try
{
config = Config.ReadObject<PluginConfig>();
if (config == null) throw new Exception();
}
catch
{
PrintWarning("Configuration file is invalid, using defaults");
LoadDefaultConfig();
}
SaveConfig();
}
protected override void SaveConfig() => Config.WriteObject(config);
private void Init()
{
permission.RegisterPermission(PermUnlimited, this);
}
private void OnRespawnInformationGiven(BasePlayer player, List<RespawnInformation.SpawnOptions> list)
{
if (player == null || list == null || list.Count == 0) return;
int max = config?.MaxOptions ?? 8;
if (max < 0) max = 0;
if (permission.UserHasPermission(player.UserIDString, PermUnlimited)) return;
if (list.Count <= max) return;
// Trim surplus options, keeping the first entries the game produced.
for (int i = list.Count - 1; i >= max; i--)
{
list.RemoveAt(i);
}
}
}
}The plugin caps how many spawn options each player can see on the respawn screen. It registers a permission so admins can be exempt. In OnRespawnInformationGiven it walks the option list backwards, removes entries once the count exceeds the configured maximum, and keeps the rest in their original order. The config exposes MaxOptions, letting admins tune the cap without editing code. Because the hook is called on every respawn screen send, the work is kept to a simple list trim with no logging, and the player argument is null-checked before any permission lookup so server-side or unusual calls cannot throw.
Common use cases
Cap the number of spawn points shown
Trim the list to a fixed maximum so players with dozens of bags get a manageable menu. Remove entries from the end of the list to keep the first choices.
Hide spawns for restricted players
Clear or shorten the list for players missing a permission so they cannot pick a bed spawn until they gain access.
Audit which options are offered
Compare the list contents against your own records to confirm expected bags and beds appear before players see them.
Pitfalls
Do not return a new list
The return value is discarded because the hook is injected into a void method with continue behavior. Modifying the passed list in place is the only way to change the client menu.
SpawnOptions fields are limited
The protobuf type exposes a small set of fields such as
nameandid. Do not assume you can read the world position or owner from the option itself; cross-reference with your own data if needed.Async path is not covered
When the server uses the external collection path, options are built asynchronously and this hook is not the only builder. Treat filtering as a best-effort trim rather than a hard guarantee.
Build a plugin with OnRespawnInformationGiven
Describe what should happen and get a compiled plugin that uses this hook.
Edit the prompt on the next screen. 2 free plugins a month, no card.
Last updated Oct 26, 2026. Found a mistake? Email support@rustplugingenerator.com.
Build a plugin with OnRespawnInformationGiven
Generate