# Developer > Developer API reference for ML Airdrop Category: AIRDROP · Source: https://miciomods.it/docs/ml-airdrop-developer · Last updated: 2026-07-28 ## Overview Integrate through the `open/` folder, where server, client and shared handlers let you hook the drop lifecycle without touching the core. Two server exports let other resources trigger drops and read the active ones. ## Server Exports - `TriggerAirdrop(spec?)`: starts a drop and returns its uid, or `nil` plus a reason. The calling resource must be listed in `Config.AdminExportResources`. - `GetActiveDrops()`: returns the list of active drops with their state and coordinates. **server.lua** ```lua -- spec fields are all optional local uid, reason = exports.ml_airdrop:TriggerAirdrop({ crateId = 'military', -- omit for the default or a random crate planeId = 'cargobob_titan', zoneId = 'downtown', -- omit for a random zone contested = true, -- false locks the drop to the caller }) ``` ## Server Handlers Located in `open/server.lua`. Return `false` from a `Before` handler to block that step. **open/server.lua** ```lua function OpenServer.BeforeTrigger(src, triggerKind, opts) return true end function OpenServer.OnDropSpawned(drop) end function OpenServer.OnDropLanded(drop) end function OpenServer.ModifyLoot(drop, stock) return stock end function OpenServer.BeforeGiveLoot(src, drop, entry) return true end function OpenServer.OnLootGiven(src, drop, entry) end function OpenServer.BeforeVehicleClaim(src, drop, model) return true end function OpenServer.OnVehicleClaimed(src, payload) end function OpenServer.CanCallFlare(src) return true end function OpenServer.OnDropDespawned(drop, reason) end ``` - `BeforeTrigger`: fires before a drop starts. `triggerKind` is `auto`, `admin`, `flare` or `export`. - `OnDropSpawned` / `OnDropLanded` - fire as the drop goes inbound and when it lands. - `ModifyLoot`: mutate and return the rolled loot before it is locked in. - `BeforeGiveLoot` / `OnLootGiven` - gate and observe each captured slot. - `BeforeVehicleClaim` / `OnVehicleClaimed` - gate and observe a vehicle claim. Register ownership here. - `CanCallFlare`: gate whether a player may call a drop with a flare item. - `OnDropDespawned`: fires on cleanup. `reason` is `emptied`, `expired` or `forced`. ## Client Handlers Located in `open/client.lua`. **open/client.lua** ```lua function OpenClient.Notify(message, type) Bridge.Notify(message, type) end function OpenClient.BeforeOpenLoot(drop) return true end function OpenClient.AfterLanded(drop) end function OpenClient.AfterOpened(drop) end function OpenClient.AfterCaptureItem(drop, item, count) end ``` - `Notify`: route notifications through your own HUD. - `BeforeOpenLoot`: return `false` to block the loot panel from opening. - `AfterLanded` / `AfterOpened` / `AfterCaptureItem` - observe the lifecycle on this client. ## Shared Handlers Located in `open/shared.lua`. **open/shared.lua** ```lua function OpenShared.ResolveId(kind, id) return id end ``` - `ResolveId`: remap a crate, loot, plane or zone id before it is used, for example a seasonal swap. ## Minigames Crate open minigames are adapters in `open/minigames`. Each returns whether the player passed, and registers itself into `Config.AirdropMiniGames`. **open/minigames/_template.lua** ```lua Config.AirdropMiniGames['my_game'] = { label = 'My Minigame', Start = function() -- run your minigame, return true on success return true end, } ``` ## Examples **Call a drop from another resource** List your resource in `Config.AdminExportResources`, then: **server.lua** ```lua exports.ml_airdrop:TriggerAirdrop({ crateId = 'military', contested = true }) ``` **Block drops during a raid event** **open/server.lua** ```lua function OpenServer.BeforeTrigger(src, triggerKind, opts) if MyEvent and MyEvent.active then return false end return true end ``` **Give a bonus when loot is taken** **open/server.lua** ```lua function OpenServer.OnLootGiven(src, drop, entry) -- runs once per captured slot end ```