OnItemDespawn
OxideCarbonItemCalled when item despawn occurs.
void OnItemDespawn(object item)Works — the game method in this build is the one the hook was written for.
Parameters
- item
- object
Return value
voidThe return value is ignored — the hook only notifies.
Example
private void OnItemDespawn(object item)
{
Puts("OnItemDespawn");
}Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.
Injection point
Rust.opj (Oxide)
void DroppedItem.IdleDestroy()
Passes: object item
WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (this.item)Assembly-CSharp.dll
Where it is called (this branch's game code)
public void IdleDestroy()
{
Interface.CallHook("OnItemDespawn", this.item);
Analytics.Azure.OnItemDespawn(this, item, (int)DropReason, DroppedBy);
if (item != null)
{
BuriedItems.Instance.Register(item, transform.position);
}
DestroyItem();
Kill();
}Sources: Rust.opj from OxideMod/Oxide.Rust (MIT) and hook metadata of the Carbon documentation (MIT). Method code is decompiled from this branch's server.