How to make a Rust quarry and excavator multiplier plugin (separate rates)
Multiplies the output of mining quarries, pump jacks and the giant excavator with independent multipliers. It uses OnQuarryGather for quarry and pump jack drops, and OnExcavatorGather for excavator output.
Official Rust servers give every quarry the same yield, and the giant excavator is tied to its own loot tables, so admins who want a faster resource economy have no per-machine control. The two hooks that gate this are OnQuarryGather(MiningQuarry, Item) and OnExcavatorGather(ExcavatorArm, Item), both of which can return a replacement Item before the drop reaches the machine's output container.
This plugin intercepts both hooks, adds a bonus amount onto the incoming item stack, and applies separate multipliers for quarries/pump jacks and for the excavator. Each resource shortname can override the global multiplier or be disabled entirely with 0, and a permission can cap the multiplier for players who are not allowed the full rate. Everything lives in one config file, no commands are needed, and it can be reloaded without a restart.
The plugin code
using System.Linq;
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Oxide.Core;
using UnityEngine;
namespace Oxide.Plugins
{
[Info("Quarry Excavator Multiplier", "RustPluginGenerator", "1.0.0")]
[Description("Multiplies quarry, pump jack and giant excavator output with separate configurable rates.")]
public class QuarryExcavatorMultiplier : RustPlugin
{
private const string PermUse = "quarryexcavatormultiplier.use";
private PluginConfig config;
private class PluginConfig
{
[JsonProperty("Quarry multiplier")]
public float QuarryMultiplier = 2.0f;
[JsonProperty("Excavator multiplier")]
public float ExcavatorMultiplier = 2.0f;
[JsonProperty("Per-resource multipliers (shortname = multiplier, 0 disables)")]
public Dictionary<string, float> PerResource = new Dictionary<string, float>
{
["sulfur.ore"] = 2.0f,
["hq.metal.ore"] = 1.5f
};
[JsonProperty("Limits")]
public LimitsConfig Limits = new LimitsConfig();
[JsonProperty("Permissions")]
public PermissionsConfig Permissions = new PermissionsConfig();
}
private class LimitsConfig
{
[JsonProperty("Max amount per drop (0 = no limit)")]
public int MaxAmountPerDrop = 1000;
}
private class PermissionsConfig
{
[JsonProperty("Require permission for full multiplier")]
public bool RequireToUse = true;
[JsonProperty("Multiplier for players without permission")]
public float LimitedMultiplier = 1.0f;
}
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(PermUse, this);
}
private object OnQuarryGather(MiningQuarry miningQuarry, Item item)
{
return Multiply(miningQuarry, item, config.QuarryMultiplier, true);
}
private object OnExcavatorGather(ExcavatorArm excavatorArm, Item item)
{
return Multiply(excavatorArm, item, config.ExcavatorMultiplier, false);
}
private object Multiply(BaseEntity machine, Item item, float baseMultiplier, bool isQuarry)
{
if (machine == null || item == null || item.info == null)
return null;
float multiplier = baseMultiplier;
float overrideValue;
if (config.PerResource != null && config.PerResource.TryGetValue(item.info.shortname, out overrideValue))
multiplier = overrideValue;
if (multiplier <= 0f)
return null;
if (config.Permissions.RequireToUse)
{
BasePlayer owner = machine.OwnerID == 0 ? null : BasePlayer.FindByID(machine.OwnerID);
if (owner == null || !permission.UserHasPermission(owner.UserIDString, PermUse))
multiplier = Mathf.Min(multiplier, config.Permissions.LimitedMultiplier);
}
if (Mathf.Approximately(multiplier, 1f))
return null;
int original = item.amount;
int extra = Mathf.RoundToInt(original * (multiplier - 1f));
if (extra <= 0)
return null;
int cap = config.Limits == null ? 0 : config.Limits.MaxAmountPerDrop;
int max = item.info.stackable > 0 ? item.info.stackable : int.MaxValue;
if (cap > 0) max = Mathf.Min(max, cap);
int newAmount = Mathf.Min(original + extra, max);
if (newAmount <= original)
return null;
item.amount = newAmount;
item.MarkDirty();
return item;
}
}
}Hooks used: OnQuarryGather, OnExcavatorGather
Config file
Created automatically on first load at oxide/config/QuarryExcavatorMultiplier.json.
{
"Quarry multiplier": 2,
"Excavator multiplier": 2,
"Per-resource multipliers (shortname = multiplier, 0 disables)": {
"sulfur.ore": 2,
"hq.metal.ore": 1.5
},
"Limits": {
"Max amount per drop (0 = no limit)": 1000
},
"Permissions": {
"Require permission for full multiplier": true,
"Multiplier for players without permission": 1
}
}Commands and permissions
No chat commands. The plugin works on its own.
| Permission | Grants |
|---|---|
quarryexcavatormultiplier.use | Grants access to the full configured multipliers. Players without it get the LimitedMultiplier value instead. |
How the code works
Intercept quarry output with OnQuarryGather
OnQuarryGather(MiningQuarry miningQuarry, Item item)fires when a quarry or pump jack tries to add a stack to its output. TheItemargument is the stack being gained, so itsamountandinfo.shortnametell you what resource is produced and how much.OnQuarryGatherpasses the machine, the item andconfig.QuarryMultiplierinto the sharedMultiplymethod. Because this hook can fire several times per second, the body stays cheap: no logging, no network calls, no entity scans.Intercept excavator output with OnExcavatorGather
OnExcavatorGather(ExcavatorArm excavatorArm, Item item)works the same way for the giant excavator at the monument. It callsMultiplywithconfig.ExcavatorMultiplierinstead. The excavator emits many small drops while it runs, so the same logic applies. Both hooks return whateverMultiplyreturns:nulllets Oxide keep the default drop, and a returned item carries the new stack size. Sharing one method means tuning the two config values cannot make the two paths behave differently.Choose the multiplier per resource
The config has
Quarry multiplierandExcavator multiplieras section defaults.Per-resource multipliers (shortname = multiplier, 0 disables)is a dictionary that maps a shortname such assulfur.oreorhq.metal.oreto an override value. TheMultiplymethod checksconfig.PerResourcefirst, then falls back to the section default. Setting a value to0makesMultiplyreturnnull, so that resource produces nothing, which turns off a resource from quarries without touching loot tables.Scale by permission and cap the result
If
Require permission for full multiplieris on,Multiplylooks upmachine.OwnerIDwithBasePlayer.FindByIDand checksquarryexcavatormultiplier.usewithpermission.UserHasPermission. Without the permission,Multiplier for players without permissionis used as a ceiling viaMathf.Min.Max amount per drop (0 = no limit)is a hard cap on the final stack size, combined with the item'sstackable, so a large sulfur multiplier cannot overflow a container.Avoid double counting and null errors
Multiplynull-checks the machine, the item anditem.infobefore readingshortnameandstackable. Without this, the excavator can fire on half-destroyed entities during a shutdown and throw errors. The plugin only mutates the incoming stack (item.amount = newAmount; item.MarkDirty();) instead of spawning its own items, so a multiplier does not duplicate drops or bypass the machine's output limit. When the new amount would not exceed the original,Multiplyreturnsnulland the drop is unchanged.
Install it on your server
Save QuarryExcavatorMultiplier.cs
Keep the file name exactly as the class name. Oxide matches them.Upload it to the plugins folder
Oxide:oxide/plugins/. Carbon:carbon/plugins/. The server compiles and loads it within a few seconds, no restart needed.Edit the config if you want
On first load the default config is written tooxide/config/QuarryExcavatorMultiplier.json(Carbon:carbon/configs/QuarryExcavatorMultiplier.json). After editing, reload it:oxide.reload QuarryExcavatorMultiplier c.reload QuarryExcavatorMultiplier # CarbonGrant the permission
Give it to every player, or swapdefaultfor a group such asvip:oxide.grant group default quarryexcavatormultiplier.use c.grant group default quarryexcavatormultiplier.use # Carbon
Variations
Each one opens the generator with a ready prompt you can tweak.
Team bonus for quarries
Adds a bonus multiplier for machines owned by members of a larger team.
Generate this versionExcavator-only events
Temporarily boosts excavator output during a scheduled event.
Generate this versionRandom bonus drop on quarry gather
Occasionally adds an extra resource when a quarry produces.
Generate this version
FAQ
Does this affect the excavator on official monuments?
Yes. OnExcavatorGather fires for the giant excavator arm regardless of the monument, so an Excavator multiplier of 2.0 doubles whatever the excavator drops. Set it to 1.0 in the config to leave the excavator untouched.
How do I install it on Oxide or Carbon?
Drop the .cs file into oxide/plugins, run oxide.reload QuarryExcavatorMultiplier in the server console, then edit the generated file in oxide/config and reload. Carbon loads the same file from the oxide/plugins folder without changes.
Why is my multiplier not applied to pump jacks?
Pump jacks use the same OnQuarryGather hook as quarries, so they follow the Quarry multiplier value. If you set a per-resource override in Per-resource multipliers, that value wins over the general quarry number.
Can a player bypass the permission?
Only if Require permission for full multiplier is false, in which case everyone gets the configured multiplier. With it enabled, players without quarryexcavatormultiplier.use get Multiplier for players without permission as a ceiling, so grant the permission to the group you want to reward.
Does a 0 multiplier remove the resource completely?
Yes. A per-resource value of 0 makes Multiply return null, so the machine still runs and still uses fuel, but that resource produces no output. This lets you remove a single resource without changing the machine's fuel or loot tables.
Customize it for your server
Change the reward, add a cooldown, restrict it to VIPs. Start from this prompt and edit anything.
Edit the prompt on the next screen. 2 free plugins a month, no card.
More gathering plugins
- Auto smelt on gatherConverts gathered metal ore into metal fragments, sulfur ore into sulfur and optionally wood into charcoal for players with a permission, usingโฆOnDispenserGatherOnDispenserBonus
- Farming yield multiplierMultiplies the amount of crops a player receives when harvesting planter crops or wild plants, with a separate multiplier per item shortname.OnServerInitializedOnGrowableGathered
- Fishing catch bonusMultiplies the amount of each caught fish and rolls a configurable chance for bonus items after every successful catch, using the OnFishCaught hook.OnFishCaught
Last updated Oct 26, 2026.
Customize quarry and excavator multiplier
Customize