Skip to content
RustPluginGenerator
Runtime errorOxide + Carbon

Fix "is using deprecated hook 'OnPlayerInit', which will stop working" (Oxide)

The plugin still defines an old Oxide hook name that Oxide has replaced with a newer one. Rename the method to the current hook (OnPlayerInit becomes OnPlayerConnected) and reload the plugin; the warning disappears.

Server console
'OldWelcome v1.0.0' is using deprecated hook 'OnPlayerInit', which will stop working on Wednesday, 1 July 2020. Please ask the author to update to 'OnPlayerConnected'

Why it happens

Oxide's Rust extension keeps a list of hook names that were renamed or removed from the API and are heading for deletion. When the plugin loader finds a method whose name matches an entry on that list, it prints the warning with the replacement name and keeps the plugin running for now. Typical triggers: a plugin written years ago still declares OnPlayerInit, OnPlayerSpawn variants or other pre-2020 names; a plugin copied from a tutorial that predates the rename; or a class where the method name has a typo that happens to match a retired hook. The warning is about your plugin source, not about the server or another plugin. It only appears from the loader at startup or reload, so if you see it once per reload on a plugin you just edited, the old method is still in the file.

How to fix it

  1. Note the two hook names in the message: the deprecated one you use now and the replacement Oxide suggests. In this case OnPlayerInit is replaced by OnPlayerConnected.
  2. Open the plugin .cs file and rename the method. Keep the same accessibility (private), the same parameters and the same body; only the name changes.
  3. If the old hook had a different signature than the new one, adapt the parameters. Check the current hook signature rather than guessing.
  4. Save the file and run oxide.reload OldWelcome. The console should print Loaded plugin OldWelcome v1.0.0 by RustPluginGenerator without the deprecation line.
  5. Search your plugin folder for other retired hook names while you are there; each one prints its own warning.

Before and after

BeforeFails
using Oxide.Core;
using UnityEngine;

namespace Oxide.Plugins
{
    [Info("OldWelcome", "RustPluginGenerator", "1.0.0")]
    [Description("Welcomes players when they first join the server")]
    public class OldWelcome : RustPlugin
    {
        private const string WelcomeMessage = "Welcome to the server, {0}! Type /help for commands.";

        // Retired hook name: Oxide warns about this at load time
        private void OnPlayerInit(BasePlayer player)
        {
            if (player == null || !player.IsConnected)
                return;

            player.ChatMessage(string.Format(WelcomeMessage, player.displayName));
            Puts(player.displayName + " joined and was welcomed");
        }
    }
}
AfterFixed
using Oxide.Core;
using UnityEngine;

namespace Oxide.Plugins
{
    [Info("OldWelcome", "RustPluginGenerator", "1.0.0")]
    [Description("Welcomes players when they join the server")]
    public class OldWelcome : RustPlugin
    {
        private const string WelcomeMessage = "Welcome to the server, {0}! Type /help for commands.";

        // Current hook name; OnPlayerInit was retired
        private void OnPlayerConnected(BasePlayer player)
        {
            if (player == null || !player.IsConnected)
                return;

            player.ChatMessage(string.Format(WelcomeMessage, player.displayName));
            Puts(player.displayName + " joined and was welcomed");
        }
    }
}

FAQ

Does the plugin still work while the warning is shown?

On the Oxide.Rust build this site targets, no deprecated-hook compatibility layer is shipped, so a removed hook name is never called. The plugin loads, but the logic inside the old method never runs. Treat the warning as a real bug, not cosmetics.

Why does the warning show a date in the past?

The date was written into Oxide when the hook was first marked obsolete. It is informational only; the removal has already happened on current builds. The message text is fixed in the framework and you cannot change it from your plugin.

Carbon shows the same message. Is the fix the same?

Yes. Carbon loads Oxide plugins and reports the same deprecation metadata from the plugin. Renaming the method to the current hook fixes both frameworks, because the fix is in your source file, not in the loader.

Different error?

Paste the full console output and get the cause and a fix in plain English.

Open the error explainer

Skip the debugging

Generated plugins are compiled before you get them, and compiler errors are fixed automatically.

Generate a plugin

2 free plugins a month, no card.

Last updated Oct 26, 2026.

Get plugins that compile first time

Generate