RustTip

OnDefaultItemsReceived

OxideCarbonPlayer

Called when a default items is received.

void OnDefaultItemsReceived(PlayerInventory playerInventory)
Method changed — check — the game method differs from the one the hook is recorded for in Oxide. The hook is still called, but its place may have shifted — worth checking after an update.

Parameters

playerInventory
PlayerInventory

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnDefaultItemsReceived(PlayerInventory playerInventory)
{
    Puts("OnDefaultItemsReceived");
}

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

Injection point

Rust.opj (Oxide)
void PlayerInventory.GiveDefaultItems()

Passes: PlayerInventory playerInventory

Method changed — checkReturnBehavior: ContinueArgumentBehavior: UseArgumentString (this)Assembly-CSharp.dll

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

// …
	TryGiveItem("partyhat", 0uL, containerWear);
}
if (IsChristmas() && !baseEntity.IsInTutorial)
{
	TryGiveItem("snowball", 0uL, containerBelt);
	TryGiveItem("snowball", 0uL, containerBelt);
	TryGiveItem("snowball", 0uL, containerBelt);
}
Interface.CallHook("OnDefaultItemsReceived", this);
defaultItemsAwaitingSkins = baseEntity.IsConnected && !baseEntity.blueprints.steamInventory.IsLoaded;
void GiveDefaultItemWithSkin(string convarSkinName, string itemShortName)
{
	ulong num = 0uL;
	int infoInt = baseEntity.GetInfoInt(convarSkinName, 0);
	bool flag = false;
	if (infoInt > 0 && baseEntity.blueprints.CheckSkinOwnership(infoInt, baseEntity))
	{
// …

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.