RustTip

OnEntityMounted

OxideCarbonPlayer

Called to validate a player's dismount position before exiting a mount or vehicle.

void OnEntityMounted(BaseMountable baseMountable, BasePlayer player)
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

baseMountable
BaseMountable
player
BasePlayer

Return value

voidThe return value is ignored — the hook only notifies.

Example

private void OnEntityMounted(BaseMountable baseMountable, BasePlayer player)
{
    Puts("OnEntityMounted");
}

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

Injection point

Rust.opj (Oxide)
void BaseMountable.MountPlayer(BasePlayer)

Passes: BaseMountable baseMountable, BasePlayer player

Method changed — checkReturnBehavior: ContinueArgumentBehavior: AllAssembly-CSharp.dll

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

// …
_mounted.eyes.NetworkUpdate(transform.rotation);
player.SendNetworkUpdateImmediate();
Analytics.Azure.OnMountEntity(player, this, VehicleParent());
OnPlayerMounted();
if (allowedGestures == MountGestureType.None && player.InGesture)
{
	player.Server_CancelGesture();
}
Interface.CallHook("OnEntityMounted", this, player);
else if (allowedGestures == MountGestureType.UpperBody && player.InGesture && player.CurrentGestureIsFullBody)
{
	player.Server_CancelGesture();
}
if (this.IsValid() && player.IsValid())
{
	player.ProcessMissionEvent(BaseMission.MissionEventType.MOUNT_ENTITY, net.ID, 1f);
}
// …

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.