RustTip

OnEntityPickedUp

OxideCarbonEntity

Called when entity picked up occurs.

void OnEntityPickedUp(BaseCombatEntity baseCombatEntity, Item createdItem, BasePlayer player)
Works — the game method in this build is the one the hook was written for.

Parameters

baseCombatEntity
BaseCombatEntity
createdItem
Item
player
BasePlayer

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnEntityPickedUp(BaseCombatEntity baseCombatEntity, Item createdItem, BasePlayer player)
{
    Puts("OnEntityPickedUp");
}

Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.

Injection point

Rust.opj (Oxide)
void BaseCombatEntity.OnPickedUp(Item, BasePlayer)

Passes: BaseCombatEntity baseCombatEntity, Item createdItem, BasePlayer player

WorksReturnBehavior: ContinueArgumentBehavior: AllAssembly-CSharp.dll

Where it is called (this branch's game code)

public virtual void OnPickedUp(Item createdItem, BasePlayer player)
{
Interface.CallHook("OnEntityPickedUp", this, createdItem, player);
}

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.