Skip to content
RustPluginGenerator

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

QuarryExcavatorMultiplier.cs
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.

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.

Permissions
PermissionGrants
quarryexcavatormultiplier.useGrants access to the full configured multipliers. Players without it get the LimitedMultiplier value instead.

How the code works

  1. 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. The Item argument is the stack being gained, so its amount and info.shortname tell you what resource is produced and how much. OnQuarryGather passes the machine, the item and config.QuarryMultiplier into the shared Multiply method. Because this hook can fire several times per second, the body stays cheap: no logging, no network calls, no entity scans.

  2. Intercept excavator output with OnExcavatorGather

    OnExcavatorGather(ExcavatorArm excavatorArm, Item item) works the same way for the giant excavator at the monument. It calls Multiply with config.ExcavatorMultiplier instead. The excavator emits many small drops while it runs, so the same logic applies. Both hooks return whatever Multiply returns: null lets 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.

  3. Choose the multiplier per resource

    The config has Quarry multiplier and Excavator multiplier as section defaults. Per-resource multipliers (shortname = multiplier, 0 disables) is a dictionary that maps a shortname such as sulfur.ore or hq.metal.ore to an override value. The Multiply method checks config.PerResource first, then falls back to the section default. Setting a value to 0 makes Multiply return null, so that resource produces nothing, which turns off a resource from quarries without touching loot tables.

  4. Scale by permission and cap the result

    If Require permission for full multiplier is on, Multiply looks up machine.OwnerID with BasePlayer.FindByID and checks quarryexcavatormultiplier.use with permission.UserHasPermission. Without the permission, Multiplier for players without permission is used as a ceiling via Mathf.Min. Max amount per drop (0 = no limit) is a hard cap on the final stack size, combined with the item's stackable, so a large sulfur multiplier cannot overflow a container.

  5. Avoid double counting and null errors

    Multiply null-checks the machine, the item and item.info before reading shortname and stackable. 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, Multiply returns null and the drop is unchanged.

Install it on your server

  1. Save QuarryExcavatorMultiplier.cs

    Keep the file name exactly as the class name. Oxide matches them.
  2. 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.
  3. Edit the config if you want

    On first load the default config is written to oxide/config/QuarryExcavatorMultiplier.json (Carbon: carbon/configs/QuarryExcavatorMultiplier.json). After editing, reload it:oxide.reload QuarryExcavatorMultiplier c.reload QuarryExcavatorMultiplier # Carbon
  4. Grant the permission

    Give it to every player, or swap default for a group such as vip: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 version
  • Excavator-only events

    Temporarily boosts excavator output during a scheduled event.

    Generate this version
  • Random 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.

Prompt: Write an Oxide Rust plugin that multiplies quarry and pump jack output using OnQuarryGather and giant excavator output using OnExcavatorGather, with a quarry multiplier config, an excavator multiplier config, per-resource overrides and a permission that limits players to a smaller multiplier.
Customize for my server

Edit the prompt on the next screen. 2 free plugins a month, no card.

Last updated Oct 26, 2026.

Customize quarry and excavator multiplier

Customize