Plugin errors and how to fix them
The errors Oxide and Carbon print when a plugin fails to compile or crashes at runtime, why they happen, and the exact code change that fixes them.
62 errors
- RuntimeFix "AddUI: Unknown Parent" for a CUI element in an Oxide pluginAddUI: Unknown Parent for "ShopUI.Items": ShopUI.MainThe client console message AddUI: Unknown Parent for "ShopUI.Items": ShopUI.Main means your CuiElementContainer adds a child element whose parent name was never sent to that…
- RuntimeFix "Assembly referenced by <plugin> plugin does not exist: Oxide.Ext.Discord.dll"Assembly referenced by DiscordLogger plugin does not exist: Oxide.Ext.Discord.dllOxide refuses to load the plugin because a // Reference: comment in the .cs file names a DLL that is not present in RustDedicated_Data/Managed (usually Oxide.Ext.Discord.dll).
- RuntimeFix "Calling 'OnEntitySpawned' ... took Nms" hook performance warning in OxideCalling 'OnEntitySpawned' on 'EntityLimits v1.0.0' took 412msOxide prints this line when a hook takes 100ms or longer, so the hook is doing too much work on the main thread.
- RuntimeFix "Calling 'OnServerSave' took average ...ms [GARBAGE COLLECT]" in Oxide pluginsCalling 'OnServerSave' on 'StatsTracker v1.0.0' took average 1250ms [GARBAGE COLLECT]Oxide logged that OnServerSave on your plugin took over 100ms and a garbage collection ran during the call.
- RuntimeFix "Collection was modified; enumeration operation may not execute" in Oxide pluginsFailed to run a 1.00 timer in 'CooldownManager v1.0.0' (InvalidOperationException: Collection was modified; enumeration operation may not execute.) at System.Collections.Generic.Dictionary`2+Enumerator[TKey,TValue].MoveNext () [0x00013] in <b0e1ad7573a24fd5a9f2af9595e677e7>:0 at Oxide.Plugins.CooldownManager.<OnServerInitialized>b__5_0 () [0x0002a] in <8f3c1a2b4d5e4f6a9b0c1d2e3f4a5b6c>:0An InvalidOperationException thrown when a Dictionary, List or HashSet is changed while a foreach loop is still walking over it.
- RuntimeFix "Could not load plugin 'name' (no plugin found with that file name)" in OxideCould not load plugin 'killrewards' (no plugin found with that file name)Oxide has no file in oxide/plugins whose base name matches the name you passed to oxide.load.
- RuntimeFix "Duplicate permission registered 'kits.use'" in Oxide pluginsDuplicate permission registered 'kits.use' (by plugin 'Kits')The warning means permission.RegisterPermission was called more than once for the same permission string during a single load of the plugin.
- RuntimeFix "Failed to call hook ... InvalidCastException: Specified cast is not valid." in Oxide pluginsFailed to call hook 'OnPlayerChat' on plugin 'ChatFilter v1.0.0' (InvalidCastException: Specified cast is not valid.) at Oxide.Plugins.ChatFilter.OnPlayerChat (BasePlayer player, System.String message, ConVar.Chat+ChatChannel channel) [0x00041] in <8f3c1a2b4d5e4f6a9b0c1d2e3f4a5b6c>:0An InvalidCastException in a hook means your code used an explicit cast like (Plugin)obj or (T)value on an object that is actually a different type at runtime.
- RuntimeFix "Failed to call hook 'OnEntityDeath'" NullReferenceException in Oxide pluginsFailed to call hook 'OnEntityDeath' on plugin 'KillRewards v1.0.0' (NullReferenceException: Object reference not set to an instance of an object) at Oxide.Plugins.KillRewards.OnEntityDeath (BaseCombatEntity entity, HitInfo info) [0x0001c] in <8f3c1a2b4d5e4f6a9b0c1d2e3f4a5b6c>:0A hook method touched a null member, usually because HitInfo or HitInfo.InitiatorPlayer is null.
- RuntimeFix "Failed to initialize plugin" NullReferenceException in Oxide pluginsFailed to initialize plugin 'ServerRewards v1.0.0' (NullReferenceException: Object reference not set to an instance of an object) at Oxide.Plugins.ServerRewards.Init () [0x00017] in <8f3c1a2b4d5e4f6a9b0c1d2e3f4a5b6c>:0The exception was thrown from the plugin's Init (or Loaded) method, so Oxide aborted loading the plugin.
- RuntimeFix "Failed to load config file (is the config file corrupt?)" in Oxide pluginsKillRewards v1.0.0: Failed to load config file (is the config file corrupt?) (Unexpected character encountered while parsing value: }. Path 'Reward amount', line 3, position 1.)The JSON in oxide/config/<Plugin>.json is not valid, so Oxide cannot deserialize it into the plugin's config class and falls back to defaults.
- RuntimeFix "Failed to load QuickSort: Info attribute missing" (Oxide)Failed to load QuickSort: Info attribute missingOxide cannot find the [Info] attribute on the plugin class, so it refuses to load the file.
- RuntimeFix "Failed to run a 5.00 timer in 'AutoDoors'" NullReferenceException (Oxide)Failed to run a 5.00 timer in 'AutoDoors v1.0.0' (NullReferenceException: Object reference not set to an instance of an object) at Oxide.Plugins.AutoDoors+<>c__DisplayClass6_0.<OnDoorOpened>b__0 () [0x00001] in <8f3c1a2b4d5e4f6a9b0c1d2e3f4a5b6c>:0A timer callback threw a NullReferenceException, so Oxide logged the failure and destroyed that timer.
- RuntimeFix "Failed to run command '/give'" IndexOutOfRangeException (Oxide)Failed to run command '/give' on plugin 'GiveCommand'. (IndexOutOfRangeException: Index was outside the bounds of the array.) at Oxide.Plugins.GiveCommand.CmdGive (BasePlayer player, System.String command, System.String[] args) [0x00008] in <8f3c1a2b4d5e4f6a9b0c1d2e3f4a5b6c>:0The chat command handler reads args[0] (or a later index) on a call where the player typed no arguments, so the array is empty.
- RuntimeFix "Failed to save config file (does the config have illegal objects in it?)" in Oxide pluginsZoneMarkers v1.0.0: Failed to save config file (does the config have illegal objects in it?) (Self referencing loop detected for property 'normalized' with type 'UnityEngine.Vector3'. Path 'Zones[0].Position.normalized'.)Newtonsoft.Json cannot serialize a UnityEngine.Vector3 (or an entity reference) stored in your config class, so oxide/config never gets written.
- RuntimeFix "Group 'vip' doesn't exist" (Oxide permissions)Group 'vip' doesn't existOxide prints this when you assign a user to a permission group (or grant a permission to a group) that has not been created yet on the server.
- RuntimeFix "is using deprecated hook 'OnPlayerInit', which will stop working" (Oxide)'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'The plugin still defines an old Oxide hook name that Oxide has replaced with a newer one.
- RuntimeFix "KeyNotFoundException: The given key was not present in the dictionary" in Oxide pluginsFailed to call hook 'OnPlayerDisconnected' on plugin 'PlaytimeTracker v1.0.0' (KeyNotFoundException: The given key was not present in the dictionary.) at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x0001e] in <b0e1ad7573a24fd5a9f2af9595e677e7>:0 at Oxide.Plugins.PlaytimeTracker.OnPlayerDisconnected (BasePlayer player, System.String reason) [0x00012] in <8f3c1a2b4d5e4f6a9b0c1d2e3f4a5b6c>:0A hook tried to read a dictionary entry with an indexer for a key that was never added.
- RuntimeFix "Main plugin class should not have a constructor defined" (Oxide)Main plugin class should not have a constructor defined: RaidAlertsOxide refuses to load a plugin whose main class declares a C# constructor.
- RuntimeFix "Missing plugin name prefix" for permission in Oxide pluginsMissing plugin name prefix 'killrewards' for permission 'rewards.use' (by plugin 'Kill Rewards')Oxide prints this warning when a registered permission does not begin with the plugin's lowercase class name followed by a dot.
- RuntimeFix "Permission '<perm>' doesn't exist" in Oxide/Rust serversPermission 'killrewards.use' doesn't existThe permission you passed to oxide.grant or oxide.revoke is not registered by any loaded plugin.
- RuntimeFix "Plugin 'AutoBroadcast' is using the Lang API but has no messages registered" (Oxide)Plugin 'AutoBroadcast' is using the Lang API but has no messages registeredOxide prints this when your plugin calls lang.GetMessage for a key that was never registered, usually because LoadDefaultMessages does not exist or does not call…
- RuntimeFix "Plugin filename killrewards.cs must match the main class KillRewards" in OxidePlugin filename killrewards.cs must match the main class KillRewards (should be KillRewards.cs)Oxide requires the .cs file name to be the class name with exactly the same spelling and letter case.
- RuntimeFix "Plugin X.cs is a uMod plugin, not an Oxide plugin. Please downgrade to the Oxide version if available."Plugin Kits.cs is a uMod plugin, not an Oxide plugin. Please downgrade to the Oxide version if available.The file declares the uMod 3 preview namespace (namespace uMod; / uMod.Plugins) and uses the uMod plugin base class instead of Oxide.Plugins.RustPlugin.
- RuntimeFix "ShopUI plugin requires missing dependency: ImageLibrary" in OxideShopUI plugin requires missing dependency: ImageLibraryThe plugin header declares a dependency that Oxide cannot find in the loaded plugin list, so Oxide refuses to initialize ShopUI.
- RuntimeFix "tried to register command 'home', this command already exists and cannot be overridden!" (Oxide)Teleport tried to register command 'home', this command already exists and cannot be overridden!Two loaded plugins claim the same chat command name.
- RuntimeFix "Unable to find main plugin class" in Oxide/Carbon Rust pluginsUnable to find main plugin class: MyPluginOxide loaded your .cs file but could not find a class it recognizes as the plugin entry point.
- RuntimeFix "Version `1.2` is invalid ... should be `major.minor.patch`" (Oxide)Version `1.2` is invalid for Better Loot, should be `major.minor.patch`Oxide rejects a plugin whose [Info] Version string does not have three numeric parts.
- RuntimeFix "Web request callback raised an exception" (NullReferenceException) in Oxide pluginsWeb request callback raised an exception in 'ServerStatus v1.0.0' plugin (NullReferenceException: Object reference not set to an instance of an object)A callback passed to webrequest.Enqueue threw an exception, so Oxide logged it and dropped the result.
- RuntimeFix ArgumentNullException: Value cannot be null. Parameter name: key (OnPlayerChat)Failed to call hook 'OnPlayerChat' on plugin 'TeamTags v1.0.0' (ArgumentNullException: Value cannot be null. Parameter name: key) at System.Collections.Generic.Dictionary`2[TKey,TValue].FindEntry (TKey key) [0x00008] in <b0e1ad7573a24fd5a9f2af9595e677e7>:0A Dictionary lookup was performed with a null string key.
- CS0019Fix CS0019: Operator '==' cannot be applied to operands of type 'NetworkableId' and 'ulong' (Oxide)Error while compiling EntityOwnerCheck: [1] Operator '==' cannot be applied to operands of type 'NetworkableId' and 'ulong' at 41:21CS0019 here means you compared an entity's net.ID (a NetworkableId struct) directly against a ulong.
- CS0029Fix CS0029: Cannot implicitly convert type 'NetworkableId' to 'uint' (Oxide)Error while compiling EntityTracker: [1] Cannot implicitly convert type 'NetworkableId' to 'uint' at 23:31Rust's BaseNetworkable.net.ID is now a NetworkableId struct, not a uint, so any code that assigns it to a uint or passes it where a uint is expected fails to compile.
- CS0051Fix CS0051: Inconsistent accessibility in Oxide pluginsError while compiling StatsApi: [1] Inconsistent accessibility: parameter type 'StatsApi.PlayerStats' is less accessible than method 'StatsApi.SaveStats(StatsApi.PlayerStats)' at 30:21CS0051 means a public method, property or constructor exposes a type that is not public, so callers outside the assembly could not name the parameter.
- CS0102Fix CS0102: The type already contains a definition (Oxide)Error while compiling ChatTitles: [1] The type 'ChatTitles' already contains a definition for 'PluginConfig' at 23:23CS0102 means the class declares the same member name twice, so Roslyn stops compiling the plugin.
- CS0103Fix CS0103: The name 'Vector3' does not exist in the current context (Oxide)Error while compiling TeleportBack: [1] The name 'Vector3' does not exist in the current context at 46:30CS0103 means the compiler cannot resolve a name you used at that line, because the type is not imported, the variable is out of scope, or the name is misspelled.
- CS0104Fix CS0104: 'Random' is an ambiguous reference (Oxide plugins)Error while compiling RandomLoot: [1] 'Random' is an ambiguous reference between 'Oxide.Core.Random' and 'UnityEngine.Random' at 28:37CS0104 means two imported namespaces both export a type called Random, so the compiler cannot pick one.
- CS0111Fix CS0111: type already defines a member with the same parameter types (Oxide)Error while compiling DeathNotes: [1] Type 'DeathNotes' already defines a member called 'OnEntityDeath' with the same parameter types at 42:22The plugin declares two methods with the same name and the same parameter types, so the compiler cannot tell them apart.
- CS0115Fix CS0115: no suitable method found to override (Oxide)Error while compiling ServerGreeter: [1] 'ServerGreeter.OnServerInitialized()': no suitable method found to override at 18:30You put the override keyword on a hook method that has no virtual base method to override.
- CS0117Fix CS0117: 'BasePlayer' does not contain a definition for 'activePlayers' (Oxide)Error while compiling OnlineCount: [1] 'BasePlayer' does not contain a definition for 'activePlayers' at 14:54The plugin references a static member of BasePlayer that does not exist — activePlayers was never a real API name.
- CS0120Fix CS0120: An object reference is required for the non-static field, method, or property (Oxide)Error while compiling PlayerUtils: [1] An object reference is required for the non-static field, method, or property 'BasePlayer.displayName' at 21:45CS0120 means you used a member of a type (for example BasePlayer.displayName) without an instance of that type, or you touched plugin instance members from a static method.
- CS0128Fix CS0128: a local variable named 'player' is already defined (Oxide)Error while compiling DamageLogger: [1] A local variable or function named 'victim' is already defined in this scope at 30:24CS0128 means the same local variable name is declared twice in one method scope.
- CS0161Fix CS0161: not all code paths return a value (Oxide)Error while compiling LootBlocker: [1] 'LootBlocker.CanLootEntity(BasePlayer, StorageContainer)': not all code paths return a value at 17:24CS0161 means your method is declared to return a value (for example a Canvas or object hook) but at least one path through the method reaches the closing brace without a return…
- CS0165Fix CS0165: Use of unassigned local variable (Oxide)Error while compiling NearestPlayer: [1] Use of unassigned local variable 'closest' at 51:21CS0165 means the compiler cannot prove a local variable was assigned before you read it.
- CS0201Fix CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement (Oxide)Error while compiling GatherBoost: [1] Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement at 36:13CS0201 means the compiler found an expression that produces a value but nothing consumes it, so the line does nothing.
- CS0234Fix CS0234: The type or namespace name 'Ext' does not exist in the namespace 'Oxide'Error while compiling DiscordReport: [1] The type or namespace name 'Discord' does not exist in the namespace 'Oxide.Ext' (are you missing an assembly reference?) at 12:27CS0234 means the compiler cannot find a type or namespace you referenced.
- CS0236Fix CS0236: A field initializer cannot reference the non-static field (Oxide)Error while compiling ZoneManagerLite: [1] A field initializer cannot reference the non-static field, method, or property 'ZoneManagerLite.config' at 15:42CS0236 means a field initializer reads another instance member, such as config, before the plugin object exists.
- CS0246Fix CS0246: 'JsonPropertyAttribute' could not be found (Oxide)Error while compiling KitCooldowns: [1] The type or namespace name 'JsonPropertyAttribute' could not be found (are you missing a using directive or an assembly reference?) at 13:14The plugin uses [JsonProperty] on config fields but never adds using Newtonsoft.Json, so the compiler cannot resolve the attribute.
- CS0246Fix CS0246: type or namespace name could not be found (Oxide)Error while compiling WelcomePanel: [1] The type or namespace name 'WelcomePanelContainer' could not be found (are you missing a using directive or an assembly reference?) at 25:13CS0246 means the C# compiler cannot resolve a type name you used, usually because the namespace that declares it was never imported.
- CS0266Fix CS0266: Cannot implicitly convert type 'BaseEntity' to 'BasePlayer' (Oxide)Error while compiling KillTracker: [1] Cannot implicitly convert type 'BaseEntity' to 'BasePlayer'. An explicit conversion exists (are you missing a cast?) at 24:33CS0266 means you assigned a value of one type to a variable of an incompatible type without a cast.
- CS0428Fix CS0428: Cannot convert method group 'MaxHealth' to non-delegate type 'float' (Oxide)Error while compiling HealthBar: [1] Cannot convert method group 'MaxHealth' to non-delegate type 'float'. Did you intend to invoke the method? at 24:32CS0428 means you used a method name as if it were a value.
- CS1002Fix CS1002: ; expected in Oxide pluginsError while compiling HelpCommand: [1] ; expected at 29:73CS1002 means the C# compiler reached the end of a statement, declaration or line and found no semicolon where one is required.
- CS1026Fix CS1026: ) expected in an Oxide plugin (PingKick)Error while compiling PingKick: [1] ) expected at 66:73CS1026 means the C# compiler reached the end of a statement while a closing parenthesis was still open.
- CS1061Fix CS1061: 'BaseEntity' does not contain a definition (Oxide)Error while compiling EntityHealthCheck: [1] 'BaseNetworkable' does not contain a definition for 'Health' and no accessible extension method 'Health' accepting a first argument of type 'BaseNetworkable' could be found (are you missing a using directive or an assembly reference?) at 35:66CS1061 means you called a member on a variable whose compile-time type does not declare it.
- CS1061Fix CS1061: 'List<Item>' does not contain a definition for 'Where' (Oxide)Error while compiling InventoryCleaner: [1] 'List<Item>' does not contain a definition for 'Where' and no accessible extension method 'Where' accepting a first argument of type 'List<Item>' could be found (are you missing a using directive or an assembly reference?) at 28:38CS1061 means the compiler cannot find the member or extension method you called.
- CS1501Fix CS1501: No overload for method takes N arguments (Oxide)Error while compiling GiveItems: [1] No overload for method 'CreateByName' takes 4 arguments at 41:41CS1501 means the method exists in the target type but none of its signatures accepts the number of arguments you passed.
- CS1503Fix CS1503: Argument 1: cannot convert from 'ulong' to 'string' (Oxide)Error while compiling VipCheck: [1] Argument 1: cannot convert from 'EncryptedValue<ulong>' to 'string' at 25:46Your code passed a numeric user ID (ulong) where the Oxide permission API expects the string form.
- CS1513Fix CS1513: } expected in Oxide plugins (AutoBroadcast example)Error while compiling AutoBroadcast: [1] } expected at 49:10CS1513 means the C# compiler reached the end of the file while a brace block was still open, so a closing brace is missing.
- CS1729Fix CS1729: 'CuiPanel' does not contain a constructor that takes 1 arguments (Oxide)Error while compiling InfoPanel: [1] 'CuiPanel' does not contain a constructor that takes 1 arguments at 26:29CS1729 means you tried to build an Oxide CUI element with constructor arguments.
- CS1955Fix CS1955: Non-invocable member 'Item.amount' cannot be used like a method (Oxide)Error while compiling StackCounter: [1] Non-invocable member 'Item.amount' cannot be used like a method. at 45:35CS1955 means you wrote a field or property followed by parentheses, as if it were a method.
- CS7036Fix CS7036: no argument given for required parameter 'callback' in Oxide pluginsError while compiling RestartTimer: [1] There is no argument given that corresponds to the required parameter 'callback' of 'PluginTimers.Once(float, Action)' at 33:34CS7036 means a method call is missing an argument that the method has no default for.
- RuntimeFix FormatException: Index (zero based) must be greater than or equal to zero (Oxide plugin)Failed to call hook 'OnPlayerConnected' on plugin 'WelcomeMessages v1.0.0' (FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.) at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x000f3] in <b0e1ad7573a24fd5a9f2af9595e677e7>:0A lang message contains a placeholder like {1} but the code passes fewer arguments to string.Format than the highest index used, so the lookup of that argument throws…
- RuntimeFix JsonReaderException when reading an oxide/data file (Unexpected character encountered while parsing value)Failed to call hook 'OnServerInitialized' on plugin 'HomeTeleport v1.0.0' (JsonReaderException: Unexpected character encountered while parsing value: }. Path 'homes', line 12, position 3.)Oxide's Newtonsoft serializer hit malformed JSON in a file under oxide/data.