Garry's Mod Wiki

GM:OnNPCDropItem

  GM:OnNPCDropItem( NPC npc, Entity item )

Recently Added

This was recently added in version (2025.07.28). It might only be available on the Dev Branch right now.

Description

Called whenever an NPC drops an item upon its death, such as health kits, armor batteries, etc.

It will NOT be called for dropped weapons, with exception of Half-Life: Source NPCs, since they don't use actual weapon entities and create a weapon entity on death.
GM:PlayerDroppedWeapon works for NPC weapon drops already. (Yes, it's not a typo)

It will also not be called for live grenades spawned by Zombine.

Arguments

1 NPC npc
The killed NPC
2 Entity item
The item that got dropped by the NPC.

Example

Removes the item an NPC drops upon it spawning

hook.Add( "OnNPCDropItem", "RemoveNPCDrops", function( npc, item ) item:Remove() end )