Skip to content
RustPluginGenerator

OnSupplyDropDropped

OnSupplyDropDropped is called by CargoPlane.Update right after the plane spawns the supply drop entity mid-flight. The entity is already spawned, so you can modify it immediately.

Signature
void OnSupplyDropDropped(BaseEntity entity, CargoPlane cargoPlane)

Parameters

Hook parameters
ParameterTypeDescription
entityBaseEntityThe BaseEntity spawned by the cargo plane when the drop is released. In practice this is the supply drop crate entity; it has already been spawned and networked when the hook fires.
cargoPlaneCargoPlaneThe CargoPlane that released the drop. Use it for its position, owner and direction of travel, and to correlate drops released from the same plane.

Return value

The return value is ignored. The game has already spawned and networked the entity before the hook fires, so returning a value or null does not change the spawn, its position or the plane's behavior.

How it works

The hook fires inside CargoPlane.Update when a plane reaches the point where it releases its payload and the game successfully creates the drop entity from the plane's configured prefab. The entity is spawned and flagged for global broadcast before the hook runs, so it exists in the world and is networked to clients. Because the call sits in Update, it fires once per release, not per frame.

entity is the newly created drop, typically a supply drop crate. Use it to tag the drop (skin, name, custom loot via LootContainer), or to set a flag your other hooks can read. cargoPlane identifies the plane; a single plane can produce several drops, so compare its net.ID if you need to group them.

There is no filtering by type: the parameter is BaseEntity. If you cast to SupplyDrop, do a null check first. Declaring SupplyDrop instead of BaseEntity does not narrow dispatch here because Oxide only skips calls when the runtime argument is not an instance of your declared type; a real supply drop will pass either way, but an unexpected prefab would break the cast.

Modifying the drop's inventory in this hook is safe because spawn has completed.

Example plugin: Announce supply drops in chat with coordinates

SupplyDropAnnouncer.cs
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Oxide.Core;
using UnityEngine;

namespace Oxide.Plugins
{
    [Info("Supply Drop Announcer", "RustPluginGenerator", "1.0.0")]
    [Description("Announces cargo plane supply drops in chat with their coordinates.")]
    public class SupplyDropAnnouncer : RustPlugin
    {
        private class PluginConfig
        {
            [JsonProperty("Announce in chat")]
            public bool AnnounceInChat = true;

            [JsonProperty("Show plane position")]
            public bool ShowPlanePosition = true;
        }

        private PluginConfig config;
        private readonly Dictionary<ulong, int> dropsPerPlane = new Dictionary<ulong, int>();

        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>
            {
                ["Drop"] = "Supply drop released! Coordinates: {0}",
                ["DropWithPlane"] = ""
            }, this);
        }

        private string Msg(string key, string userId = null, params object[] args)
            => string.Format(lang.GetMessage(key, this, userId), args);

        private void OnSupplyDropDropped(BaseEntity entity, CargoPlane cargoPlane)
        {
            if (entity == null || cargoPlane == null) return;

            if (!config.AnnounceInChat) return;

            ulong planeId = cargoPlane.net.ID.Value;
            int count;
            dropsPerPlane.TryGetValue(planeId, out count);
            dropsPerPlane[planeId] = count + 1;

            Vector3 pos = entity.transform.position;
            string coords = $"{pos.x:0}, {pos.y:0}, {pos.z:0}";

            if (config.ShowPlanePosition)
                coords = string.Format("{0} (drop #{1})", coords, count + 1);

            Server.Broadcast(Msg("Drop", null, coords));
        }

        private void Unload()
        {
            dropsPerPlane.Clear();
        }
    }
}

The plugin listens for each cargo plane supply drop release and broadcasts a chat message to all players with the drop's coordinates formatted as x, y, z. It keeps a per-plane drop counter in a dictionary keyed by cargoPlane.net.ID.Value, and when Show plane position is enabled the message includes the current drop number for that plane. The Announce in chat config option turns announcements off entirely. The plugin reads entity.transform.position directly and does not touch loot. Unload clears the drop counter dictionary.

Common use cases

  • Announce incoming drops

    Tell players in chat that a supply drop was released mid-flight, with coordinates so they can plan a route.

  • Custom drop loot

    Find the LootContainer component on the spawned entity and replace its item list before players reach it.

  • Track drops per plane

    Record net.ID values to correlate multiple drops from the same plane for analytics or admin commands.

Pitfalls

  • The entity is a BaseEntity

    The parameter type is BaseEntity. Cast to SupplyDrop or LootContainer before accessing crate-specific members, and null-check the cast.

  • Runs from Update

    The call is inside CargoPlane.Update. Keep the hook body cheap: no permission scans over all players and no heavy spawns unless you use timers.

  • Not every plane carries a drop

    Only planes with a configured drop prefab reach this call. Do not assume every CargoPlane in the world triggers the hook.

Build a plugin with OnSupplyDropDropped

Describe what should happen and get a compiled plugin that uses this hook.

Prompt: Announce incoming drops using the OnSupplyDropDropped hook, with a config file and a permission
Generate this plugin

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 OnSupplyDropDropped

Generate