OnConveyorFiltersChange
OnConveyorFiltersChange is called when a player sends the RPC that changes an industrial conveyor's item filters, before the server copies the submitted list onto the conveyor.
object OnConveyorFiltersChange(IndustrialConveyor industrialConveyor, BasePlayer player, ProtoBuf.IndustrialConveyor.ItemFilterList itemFilterList)Parameters
| Parameter | Type | Description |
|---|---|---|
industrialConveyor | IndustrialConveyor | The IndustrialConveyor entity whose filter list the player is changing. Use it for distance checks, permission scoping or to re-send its state after you cancel the change. |
player | BasePlayer | The BasePlayer who sent the RPC. It comes from the network message, so check it for null before using it. |
itemFilterList | ProtoBuf.IndustrialConveyor.ItemFilterList | The ProtoBuf.IndustrialConveyor.ItemFilterList the client wants to apply; its filters list holds item filter entries. It is cleared and read into the conveyor only if the hook returns null. |
Return value
Returning null (or nothing) lets the game copy the submitted filters onto the conveyor. Returning any non-null object aborts the rest of RPC_ChangeFilters, so the submitted filters are never applied; the returned value itself is not used.
How it works
The hook fires inside IndustrialConveyor.RPC_ChangeFilters, right after the network message is read and the conveyor's current filterItems has been cleared. The server has already parsed the mode int and the submitted filter list, so itemFilterList holds the client's requested filters. Returning a non-null value stops the method before the submitted filters are copied into the conveyor, so the conveyor keeps no filters because the clear already happened. The player parameter is the sender of the RPC, taken from the message, and is null only in unusual cases. Declaring player as BasePlayer matches the argument type exactly; a more specific type would never match and the hook would not fire for normal RPCs. This is a good place to enforce limits on filter size, gate filter editing by permission, or require the player to be close to the conveyor. It runs once per filter submission, not per item, so cost is low. Carbon loads the same hook.
Example plugin: Restrict conveyor filter editing to nearby players with permission
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Oxide.Core;
using UnityEngine;
namespace Oxide.Plugins
{
[Info("Conveyor Filter Guard", "RustPluginGenerator", "1.0.0")]
[Description("Restricts industrial conveyor filter changes by permission and distance")]
public class ConveyorFilterGuard : RustPlugin
{
private const string PermUse = "conveyorfilterguard.use";
private PluginConfig config;
private class PluginConfig
{
[JsonProperty("Maximum distance in meters")]
public float MaxDistance = 3f;
}
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);
protected override void LoadDefaultMessages()
{
lang.RegisterMessages(new Dictionary<string, string>
{
["NoPermission"] = "You are not allowed to change conveyor filters.",
["TooFar"] = "You are too far from the conveyor to change its filters."
}, this);
}
private string Msg(string key, string userId = null, params object[] args) => string.Format(lang.GetMessage(key, this, userId), args);
private void Init()
{
permission.RegisterPermission(PermUse, this);
}
private object OnConveyorFiltersChange(IndustrialConveyor industrialConveyor, BasePlayer player, ProtoBuf.IndustrialConveyor.ItemFilterList itemFilterList)
{
if (industrialConveyor == null || player == null || itemFilterList == null) return null;
if (!permission.UserHasPermission(player.UserIDString, PermUse))
{
player.ChatMessage(Msg("NoPermission", player.UserIDString));
RefreshLater(industrialConveyor);
return true;
}
if (Vector3.Distance(player.transform.position, industrialConveyor.transform.position) > config.MaxDistance)
{
player.ChatMessage(Msg("TooFar", player.UserIDString));
RefreshLater(industrialConveyor);
return true;
}
return null;
}
private void RefreshLater(IndustrialConveyor industrialConveyor)
{
NextTick(() =>
{
if (industrialConveyor == null || industrialConveyor.IsDestroyed) return;
industrialConveyor.SendNetworkUpdate();
});
}
}
}The plugin registers a permission and checks it in OnConveyorFiltersChange. A player without conveyorfilterguard.use gets the change cancelled and a localized chat message. Players who have permission must also be within the configured maximum distance of the conveyor (default 3 meters), otherwise the change is cancelled the same way. When a change is cancelled the plugin queues a network update on the conveyor on the next tick so the client's filter panel refreshes and does not show filters that were never applied. Valid changes return null and apply normally. The hook does not print anything to the console, only sends localized replies to the offending player.
Common use cases
Permission-gated filter access
Only allow players with a specific permission to edit conveyor filters, for example on servers where a base owner grants access to trusted players.
Distance enforcement
Cancel submissions from players far from the conveyor, which blocks out-of-range RPC abuse from modified clients.
Audit or reset pipeline
Cancel the change and schedule your own conveyor update to force the canonical filter state back onto the client.
Pitfalls
Cancelling leaves the filter list empty
The game clears
filterItemsbefore the hook runs, so cancelling does not restore the old filters automatically. Send a network update or reset the filters yourself if you need the old state.Parameter type must stay BasePlayer
Oxide only calls your hook when each argument matches the declared type. Declaring a subclass or object type means the hook stops firing for normal RPCs.
RPC-focused hook, not a UI hook
It fires when the client submits filters, so any UI-side restriction you build is cosmetic; the authoritative check belongs here on the server.
Build a plugin with OnConveyorFiltersChange
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 OnConveyorFiltersChange
Generate