RustTip

OnCrateLanded

OxideCarbonEntity

Called when a crate is landed.

Use this to scale timing based on context, player state, or location.

void OnCrateLanded(HackableLockedCrate hackableLockedCrate)
Works — the game method in this build is the one the hook was written for.

Parameters

hackableLockedCrate
HackableLockedCrate

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnCrateLanded(HackableLockedCrate hackableLockedCrate)
{
    Puts("OnCrateLanded");
}

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

Injection point

Rust.opj (Oxide)
void HackableLockedCrate.LandCheck()

Passes: HackableLockedCrate hackableLockedCrate

WorksReturnBehavior: ContinueArgumentBehavior: JustThisAssembly-CSharp.dll

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

public void LandCheck()
{
	if (!hasLanded && Physics.Raycast(new Ray(transform.position + Vector3.up * 0.5f, Vector3.down), out var hitInfo, 1f, 1084293377))
	{
		Effect.server.Run(landEffect.resourcePath, hitInfo.point, Vector3.up);
		hasLanded = true;
		Interface.CallHook("OnCrateLanded", this);
		CancelInvoke(LandCheck);
	}
}

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.