OnGibsSpawned
OxideCarbonEntityCalled when a gibs is spawned.
void OnGibsSpawned(List<ServerGib> list, GameObject creator)Works — the game method in this build is the one the hook was written for.
Parameters
- list
- List<ServerGib>
- creator
- GameObject
Return value
voidThe return value is ignored — the hook only notifies.
Example
private void OnGibsSpawned(List<ServerGib> list, GameObject creator)
{
Puts("OnGibsSpawned");
}Works in both Oxide and Carbon: Carbon loads Oxide plugins as is.
Injection point
Rust.opj (Oxide)
List<ServerGib> ServerGib.CreateGibs(string, GameObject, GameObject, Vector3, float)
Passes: List<ServerGib> list, GameObject creator
WorksReturnBehavior: ContinueArgumentBehavior: UseArgumentString (l0, a1)Assembly-CSharp.dll
Where it is called (this branch's game code)
// …
foreach (ServerGib item2 in list)
{
if (!(item == item2))
{
Physics.IgnoreCollision(item2.GetCollider(), item.GetCollider(), ignore: true);
}
}
}
Interface.CallHook("OnGibsSpawned", list, creator);
return list;
}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.