Player (168)

All currently available hooks that are found in Carbon. Most hooks would be ones compatible with Oxide, although there are Carbon-only ones as well.

  • Called when a player attempts to assign a bed or sleeping bag to another player.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches SleepingBag.AssignToFriend of Assembly-CSharp.dll.

Example
object CanAssignBed(BasePlayer player, SleepingBag self, ulong local0)
{
    Puts("CanAssignBed was called!");
    return (object) null;
}
  • Called when an autoturret, flame turret, shotgun trap, or helicopter turret is attempting to target the player.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches AutoTurret.ObjectVisible of Assembly-CSharp.dll.

Example
object CanBeTargeted(BaseCombatEntity obj, AutoTurret self)
{
    Puts("CanBeTargeted was called!");
    return (bool) null;
}
  • Called when an autoturret, flame turret, shotgun trap, or helicopter turret is attempting to target the player.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches HelicopterTurret.InFiringArc of Assembly-CSharp.dll.

Example
object CanBeTargeted(BaseCombatEntity potentialtarget, HelicopterTurret self)
{
    Puts("CanBeTargeted was called!");
    return (bool) null;
}
  • Called when an autoturret, flame turret, shotgun trap, or helicopter turret is attempting to target the player.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches FlameTurret.CheckTrigger of Assembly-CSharp.dll.

Example
object CanBeTargeted(BasePlayer local4, FlameTurret self)
{
    Puts("CanBeTargeted was called!");
    return (bool) null;
}
  • Called when an autoturret, flame turret, shotgun trap, or helicopter turret is attempting to target the player.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches GunTrap.CheckTrigger of Assembly-CSharp.dll.

Example
object CanBeTargeted(BasePlayer local5, GunTrap self)
{
    Puts("CanBeTargeted was called!");
    return (bool) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches FlameTurret.CheckTrigger of Assembly-CSharp.dll.

  • Hook flags:

Example
object CanBeTargeted()
{
    Puts("CanBeTargeted [patch] was called!");
    return (object) null;
}

This hook requires CanBeTargeted [FlameTurret], which loads alongside CanBeTargeted [patch].

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches GunTrap.CheckTrigger of Assembly-CSharp.dll.

  • Hook flags:

Example
object CanBeTargeted()
{
    Puts("CanBeTargeted [patch] was called!");
    return (object) null;
}

This hook requires CanBeTargeted [GunTrap], which loads alongside CanBeTargeted [patch].

  • Called when any damage is attempted on player.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.EligibleForWounding of Assembly-CSharp.dll.

Example
object CanBeWounded(BasePlayer self)
{
    Puts("CanBeWounded was called!");
    return (bool) null;
}
  • Called before the player is added to the connection queue.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ConnectionQueue.CanJumpQueue of Assembly-CSharp.dll.

Example
object CanBypassQueue()
{
    Puts("CanBypassQueue was called!");
    return (bool) null;
}
  • Called when a player tries to change the code on a codelock.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CodeLock.RPC_ChangeCode of Assembly-CSharp.dll.

Example
object CanChangeCode(BasePlayer player, CodeLock self, string local0, bool local1)
{
    Puts("CanChangeCode was called!");
    return (object) null;
}
  • Gets called when a client should or not should join the server.

  • Called when the player is attempting to login.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CorePlugin.IOnUserApprove.

Example
object CanClientLogin(Network.Connection connection)
{
    Puts("CanClientLogin was called!");
    return (bool) null;
}
  • Called when the player attempts to dismount an entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseMountable.DismountPlayer of Assembly-CSharp.dll.

Example
object CanDismountEntity(BasePlayer player, BaseMountable self)
{
    Puts("CanDismountEntity was called!");
    return (object) null;
}
  • Called when a player attempts to drop their active item.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.ShouldDropActiveItem of Assembly-CSharp.dll.

Example
object CanDropActiveItem(BasePlayer self)
{
    Puts("CanDropActiveItem was called!");
    return (bool) null;
}
  • Called when a player starts hacking a locked crate.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches HackableLockedCrate.RPC_Hack of Assembly-CSharp.dll.

Example
object CanHackCrate(BasePlayer player, HackableLockedCrate self)
{
    Puts("CanHackCrate was called!");
    return (object) null;
}
  • Called when a player tries to hide a stash.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches StashContainer.RPC_HideStash of Assembly-CSharp.dll.

Example
object CanHideStash(BasePlayer player, StashContainer self)
{
    Puts("CanHideStash was called!");
    return (object) null;
}
  • Useful for canceling the lock action.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CodeLock.TryLock of Assembly-CSharp.dll.

Example
object CanLock(BasePlayer player, CodeLock self)
{
    Puts("CanLock was called!");
    return (object) null;
}
  • Useful for canceling the lock action.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches KeyLock.Lock of Assembly-CSharp.dll.

Example
object CanLock(BasePlayer player, KeyLock self)
{
    Puts("CanLock was called!");
    return (object) null;
}
  • Called when the player starts looting a DroppedItemContainer, LootableCorpse, ResourceContainer, BaseRidableAnimal, or StorageContainer entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches LootableCorpse.RPC_LootCorpse of Assembly-CSharp.dll.

Example
object CanLootEntity(BasePlayer local0, LootableCorpse self)
{
    Puts("CanLootEntity was called!");
    return (object) null;
}
  • Called when the player starts looting a DroppedItemContainer, LootableCorpse, ResourceContainer, BaseRidableAnimal, or StorageContainer entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches StorageContainer.PlayerOpenLoot of Assembly-CSharp.dll.

Example
object CanLootEntity()
{
    Puts("CanLootEntity was called!");
    return (object) null;
}
  • Called when the player starts looting a DroppedItemContainer, LootableCorpse, ResourceContainer, BaseRidableAnimal, or StorageContainer entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ResourceContainer.StartLootingContainer of Assembly-CSharp.dll.

Example
object CanLootEntity(BasePlayer local0, ResourceContainer self)
{
    Puts("CanLootEntity was called!");
    return (object) null;
}
  • Called when the player starts looting a DroppedItemContainer, LootableCorpse, ResourceContainer, BaseRidableAnimal, or StorageContainer entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches DroppedItemContainer.RPC_OpenLoot of Assembly-CSharp.dll.

Example
object CanLootEntity(BasePlayer local0, DroppedItemContainer self)
{
    Puts("CanLootEntity was called!");
    return (object) null;
}
  • Called when the player starts looting a DroppedItemContainer, LootableCorpse, ResourceContainer, BaseRidableAnimal, or StorageContainer entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseRidableAnimal.RPC_OpenLoot of Assembly-CSharp.dll.

Example
object CanLootEntity(BasePlayer local0, BaseRidableAnimal self)
{
    Puts("CanLootEntity was called!");
    return (object) null;
}
  • Called when the player starts looting a DroppedItemContainer, LootableCorpse, ResourceContainer, BaseRidableAnimal, or StorageContainer entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ContainerIOEntity.PlayerOpenLoot of Assembly-CSharp.dll.

Example
object CanLootEntity()
{
    Puts("CanLootEntity was called!");
    return (object) null;
}
  • Called when the player starts looting a DroppedItemContainer, LootableCorpse, ResourceContainer, BaseRidableAnimal, or StorageContainer entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches IndustrialCrafter.PlayerOpenLoot of Assembly-CSharp.dll.

Example
object CanLootEntity()
{
    Puts("CanLootEntity was called!");
    return (object) null;
}
  • Called when the player attempts to loot another player.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.CanBeLooted of Assembly-CSharp.dll.

Example
object CanLootPlayer(BasePlayer self)
{
    Puts("CanLootPlayer was called!");
    return (bool) null;
}
  • Called when the player attempts to mount an entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseMountable.MountPlayer of Assembly-CSharp.dll.

Example
object CanMountEntity(BasePlayer player, BaseMountable self)
{
    Puts("CanMountEntity was called!");
    return (object) null;
}
  • Called when an entity attempts to network with a player.

  • For better performance, avoid using heavy calculations in this hook.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.ShouldNetworkTo of Assembly-CSharp.dll.

Example
object CanNetworkTo(BasePlayer self)
{
    Puts("CanNetworkTo was called!");
    return (bool) null;
}
  • Called when a player attempts to pickup a deployed entity (AutoTurret, BaseMountable, BearTrap, DecorDeployable, Door, DoorCloser, ReactiveTarget, SamSite, SleepingBag, SpinnerWheel, StorageContainer, etc.).

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseCombatEntity.CanPickup of Assembly-CSharp.dll.

Example
object CanPickupEntity(BasePlayer player, BaseCombatEntity self)
{
    Puts("CanPickupEntity was called!");
    return (bool) null;
}
  • Called when a player attempts to pickup a lock.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseLock.RPC_TakeLock of Assembly-CSharp.dll.

Example
object CanPickupLock(BasePlayer player, BaseLock self)
{
    Puts("CanPickupLock was called!");
    return (object) null;
}
  • Overrides the IsSpectating check, overriding the result.

  • Returning a non-null value cancels default behavior.

  • This hook is Carbon-only compatible.

  • Patches BasePlayer.ShouldInheritNetworkGroup.

Example
object CanPlayerInheritNetworkGroup(BasePlayer player)
{
    Puts("CanPlayerInheritNetworkGroup was called!");
    return (bool) null;
}
  • Called when the player attempts to rename a bed or sleeping bag.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches SleepingBag.Rename of Assembly-CSharp.dll.

Example
object CanRenameBed(BasePlayer player, SleepingBag self, string local0)
{
    Puts("CanRenameBed was called!");
    return (object) null;
}
  • Called when the player attempts to research an item.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ResearchTable.DoResearch of Assembly-CSharp.dll.

Example
object CanResearchItem(BasePlayer local0, Item local1)
{
    Puts("CanResearchItem was called!");
    return (object) null;
}
  • Called when a player tries to set a bed public.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches SleepingBag.RPC_MakePublic of Assembly-CSharp.dll.

Example
object CanSetBedPublic(BasePlayer player, SleepingBag self)
{
    Puts("CanSetBedPublic was called!");
    return (object) null;
}
  • Called when a player's relationship with another is about to be updated.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches RelationshipManager.SetRelationship of Assembly-CSharp.dll.

Example
object CanSetRelationship(BasePlayer player, BasePlayer otherPlayer, RelationshipManager.RelationshipType type, int weight)
{
    Puts("CanSetRelationship was called!");
    return (object) null;
}
  • Called when spectate target is attempting to update.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.UpdateSpectateTarget of Assembly-CSharp.dll.

Example
object CanSpectateTarget(BasePlayer self, string strName)
{
    Puts("CanSpectateTarget was called!");
    return (object) null;
}
  • Called when a player tries to switch seats, to determine whether each seat is eligible to be swapped to.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseMountable.CanSwapToThis of Assembly-CSharp.dll.

Example
object CanSwapToSeat(BasePlayer player, BaseMountable self)
{
    Puts("CanSwapToSeat was called!");
    return (bool) null;
}
  • Called when a player tries to switch seats, to determine whether each seat is eligible to be swapped to.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ModularCarSeat.CanSwapToThis of Assembly-CSharp.dll.

Example
object CanSwapToSeat(BasePlayer player, ModularCarSeat self)
{
    Puts("CanSwapToSeat was called!");
    return (bool) null;
}
  • Called when a player is trying to take a cutting (clone) of a GrowableEntity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches GrowableEntity.TakeClones of Assembly-CSharp.dll.

Example
object CanTakeCutting(BasePlayer player, GrowableEntity self)
{
    Puts("CanTakeCutting was called!");
    return (object) null;
}
  • Called when the player tries to unlock a keylock or codelock.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CodeLock.TryUnlock of Assembly-CSharp.dll.

Example
object CanUnlock(BasePlayer player, CodeLock self)
{
    Puts("CanUnlock was called!");
    return (object) null;
}
  • Called when the player tries to unlock a keylock or codelock.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches KeyLock.RPC_Unlock of Assembly-CSharp.dll.

Example
object CanUnlock(BasePlayer player, KeyLock self)
{
    Puts("CanUnlock was called!");
    return (object) null;
}
  • Called when the player tries to unlock a keylock or codelock.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ModularCarCodeLock.TryOpenWithCode of Assembly-CSharp.dll.

Example
object CanUnlock(BasePlayer player, ModularCarCodeLock self, string codeEntered)
{
    Puts("CanUnlock was called!");
    return (bool) null;
}
  • Called when the player attempts to change the text on a sign or lock it, or update a photo frame.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches Signage.CanUpdateSign of Assembly-CSharp.dll.

Example
object CanUpdateSign(BasePlayer player, Signage self)
{
    Puts("CanUpdateSign was called!");
    return (bool) null;
}
  • Called when the player attempts to change the text on a sign or lock it, or update a photo frame.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PhotoFrame.CanUpdateSign of Assembly-CSharp.dll.

Example
object CanUpdateSign(BasePlayer player, PhotoFrame self)
{
    Puts("CanUpdateSign was called!");
    return (bool) null;
}
  • Called when the player attempts to change the text on a sign or lock it, or update a photo frame.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CarvablePumpkin.CanUpdateSign of Assembly-CSharp.dll.

Example
object CanUpdateSign(BasePlayer player, CarvablePumpkin self)
{
    Puts("CanUpdateSign was called!");
    return (bool) null;
}
  • Called when a player attempts to use a gesture.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches GestureConfig.IsOwnedBy of Assembly-CSharp.dll.

Example
object CanUseGesture(BasePlayer player, GestureConfig self)
{
    Puts("CanUseGesture was called!");
    return (bool) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is Carbon-only compatible.

  • Patches HBHFSensor.CanUse of Assembly-CSharp.dll.

Example
object CanUseHBHFSensor(BasePlayer player, HBHFSensor self)
{
    Puts("CanUseHBHFSensor was called!");
    return (bool) null;
}
  • Called when the player tries to use an entity that is locked.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CodeLock.OnTryToOpen of Assembly-CSharp.dll.

Example
object CanUseLockedEntity(BasePlayer player, CodeLock self)
{
    Puts("CanUseLockedEntity was called!");
    return (bool) null;
}
  • Called when the player tries to use an entity that is locked.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CodeLock.OnTryToClose of Assembly-CSharp.dll.

Example
object CanUseLockedEntity(BasePlayer player, CodeLock self)
{
    Puts("CanUseLockedEntity was called!");
    return (bool) null;
}
  • Called when the player tries to use an entity that is locked.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches KeyLock.OnTryToClose of Assembly-CSharp.dll.

Example
object CanUseLockedEntity(BasePlayer player, KeyLock self)
{
    Puts("CanUseLockedEntity was called!");
    return (bool) null;
}
  • Called when the player tries to use an entity that is locked.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches KeyLock.OnTryToOpen of Assembly-CSharp.dll.

Example
object CanUseLockedEntity(BasePlayer player, KeyLock self)
{
    Puts("CanUseLockedEntity was called!");
    return (bool) null;
}
  • Called when the player tries to use a mailbox.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches Mailbox.PlayerIsOwner of Assembly-CSharp.dll.

Example
object CanUseMailbox(BasePlayer player, Mailbox self)
{
    Puts("CanUseMailbox was called!");
    return (bool) null;
}
  • Gets called when a client should or not should join the server.

  • Called when a player is attempting to connect to the server.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CorePlugin.IOnUserApprove.

Example
object CanUserLogin(string username, string userid, string ip)
{
    Puts("CanUserLogin was called!");
    return (bool) null;
}
  • Useful for allowing or preventing a player from using wires.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches WireTool.CanPlayerUseWires of Assembly-CSharp.dll.

Example
object CanUseWires()
{
    Puts("CanUseWires was called!");
    return (bool) null;
}
  • Called when active item is attempting to update.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.UpdateActiveItem of Assembly-CSharp.dll.

Example
object OnActiveItemChange(BasePlayer self, Item local1, ItemId itemID)
{
    Puts("OnActiveItemChange was called!");
    return (object) null;
}
  • Called when active item was changed.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.UpdateActiveItem of Assembly-CSharp.dll.

Example
void OnActiveItemChanged(BasePlayer self, Item local1, Item local2)
{
    Puts("OnActiveItemChanged was called!");
}

This hook requires OnActiveItemChange, which loads alongside OnActiveItemChanged.

  • Called when the player is giving server connection authorization information.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ServerMgr.OnGiveUserInformation of Assembly-CSharp.dll.

Example
void OnClientAuth(Network.Connection connection)
{
    Puts("OnClientAuth was called!");
}
  • Useful for intercepting players' commands before their handling.

  • Called before OnPlayerCommand and OnUserCommand.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ConsoleNetwork.OnClientCommand of Assembly-CSharp.dll.

Example
object OnClientCommand(Network.Connection connection, string local0)
{
    Puts("OnClientCommand was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ServerMgr.ReadDisconnectReason of Assembly-CSharp.dll.

Example
void OnClientDisconnect(Network.Connection connection, string local0)
{
    Puts("OnClientDisconnect was called!");
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches Server.OnDisconnected of Facepunch.Network.dll.

Example
void OnClientDisconnected(Network.Connection cn, string strReason)
{
    Puts("OnClientDisconnected was called!");
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseProjectile.CreateProjectileEffectClientside of Assembly-CSharp.dll.

Example
object OnClientProjectileEffectCreate(Network.Connection sourceConnection, BaseProjectile self, string prefabName)
{
    Puts("OnClientProjectileEffectCreate was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PlayerInventory.OnClothingChanged of Assembly-CSharp.dll.

Example
void OnClothingItemChanged(PlayerInventory self, Item item, bool bAdded)
{
    Puts("OnClothingItemChanged was called!");
}
  • Called when a player is about to receive default items.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PlayerInventory.GiveDefaultItems of Assembly-CSharp.dll.

Example
object OnDefaultItemsReceive(PlayerInventory self)
{
    Puts("OnDefaultItemsReceive was called!");
    return (object) null;
}
  • Called after a player has received default items.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PlayerInventory.GiveDefaultItems of Assembly-CSharp.dll.

Example
void OnDefaultItemsReceived(PlayerInventory self)
{
    Puts("OnDefaultItemsReceived was called!");
}

This hook requires OnDefaultItemsReceive, which loads alongside OnDefaultItemsReceived.

  • Called right before a demo of a player starts recording.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.StartDemoRecording of Assembly-CSharp.dll.

Example
object OnDemoRecordingStart(string local0, BasePlayer self)
{
    Puts("OnDemoRecordingStart was called!");
    return (object) null;
}
  • Called after a demo of a player has started recording.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.StartDemoRecording of Assembly-CSharp.dll.

Example
void OnDemoRecordingStarted(string local0, BasePlayer self)
{
    Puts("OnDemoRecordingStarted was called!");
}

This hook requires OnDemoRecordingStart, which loads alongside OnDemoRecordingStarted.

  • Called right before a demo of a player stops recording.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.StopDemoRecording of Assembly-CSharp.dll.

Example
object OnDemoRecordingStop(BasePlayer self, BasePlayer self1)
{
    Puts("OnDemoRecordingStop was called!");
    return (object) null;
}
  • Called after a demo of a player has stopped recording.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.StopDemoRecording of Assembly-CSharp.dll.

Example
void OnDemoRecordingStopped(BasePlayer self, BasePlayer self1)
{
    Puts("OnDemoRecordingStopped was called!");
}

This hook requires OnDemoRecordingStop, which loads alongside OnDemoRecordingStopped.

  • Called when an entity is mounted by a player.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseMountable.MountPlayer of Assembly-CSharp.dll.

Example
void OnEntityMounted(BaseMountable self)
{
    Puts("OnEntityMounted was called!");
}

This hook requires CanMountEntity, which loads alongside OnEntityMounted.

  • Called when an experiment is about to end.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches Workbench.ExperimentComplete of Assembly-CSharp.dll.

Example
object OnExperimentEnd(Workbench self)
{
    Puts("OnExperimentEnd was called!");
    return (object) null;
}
  • Called after the experiment has finished.

  • No return behaviour.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches Workbench.ExperimentComplete of Assembly-CSharp.dll.

Example
void OnExperimentEnded(Workbench self)
{
    Puts("OnExperimentEnded was called!");
}

This hook requires OnExperimentEnd, which loads alongside OnExperimentEnded.

  • Called when the player attempts to experiment with at a workbench.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches Workbench.RPC_BeginExperiment of Assembly-CSharp.dll.

Example
object OnExperimentStart(Workbench self, BasePlayer local0)
{
    Puts("OnExperimentStart was called!");
    return (object) null;
}
  • Called after the experimentation has started.

  • No return behaviour.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches Workbench.RPC_BeginExperiment of Assembly-CSharp.dll.

Example
void OnExperimentStarted(Workbench self, BasePlayer local0)
{
    Puts("OnExperimentStarted was called!");
}

This hook requires OnExperimentStart, which loads alongside OnExperimentStarted.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches AttackEntity.ValidateEyePos of Assembly-CSharp.dll.

Example
object OnEyePosValidate(AttackEntity self, BasePlayer player, UnityEngine.Vector3 eyePos, bool checkLineOfSight)
{
    Puts("OnEyePosValidate was called!");
    return (bool) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.OnFeedbackReport of Assembly-CSharp.dll.

Example
void OnFeedbackReported(BasePlayer self, string local0, string local1, Facepunch.Models.ReportType local2)
{
    Puts("OnFeedbackReported was called!");
}
  • Useful for controlling player spawnpoints (like making all spawns occur in a set area).

  • Return a BasePlayer.SpawnPoint object to use that spawnpoint.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ServerMgr.FindSpawnPoint of Assembly-CSharp.dll.

Example
object OnFindSpawnPoint()
{
    Puts("OnFindSpawnPoint was called!");
    return (BasePlayer.SpawnPoint) null;
}
  • Called after a player's inventory contents have changed, before it is sent over the network to one or more clients.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PlayerInventory.SendUpdatedInventoryInternal of Assembly-CSharp.dll.

Example
object OnInventoryNetworkUpdate(PlayerInventory self, ItemContainer container, ProtoBuf.UpdateItemContainer local0, PlayerInventory.Type type, PlayerInventory.NetworkInventoryMode mode)
{
    Puts("OnInventoryNetworkUpdate was called!");
    return (object) null;
}
  • Called when the player starts looting an entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PlayerLoot.StartLootingEntity of Assembly-CSharp.dll.

Example
void OnLootEntity(PlayerLoot self, BaseEntity targetEntity)
{
    Puts("OnLootEntity was called!");
}
  • Called when the player stops looting an entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches LootableCorpse.PlayerStoppedLooting of Assembly-CSharp.dll.

Example
void OnLootEntityEnd(BasePlayer player, LootableCorpse self)
{
    Puts("OnLootEntityEnd was called!");
}
  • Called when the player stops looting an entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches StorageContainer.PlayerStoppedLooting of Assembly-CSharp.dll.

Example
void OnLootEntityEnd(BasePlayer player, StorageContainer self)
{
    Puts("OnLootEntityEnd was called!");
}
  • Called when the player stops looting an entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches DroppedItemContainer.PlayerStoppedLooting of Assembly-CSharp.dll.

Example
void OnLootEntityEnd(BasePlayer player, DroppedItemContainer self)
{
    Puts("OnLootEntityEnd was called!");
}
  • Called when the player stops looting an entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ContainerIOEntity.PlayerStoppedLooting of Assembly-CSharp.dll.

Example
void OnLootEntityEnd(BasePlayer player, ContainerIOEntity self)
{
    Puts("OnLootEntityEnd was called!");
}
  • Called when the player stops looting an entity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ItemBasedFlowRestrictor.PlayerStoppedLooting of Assembly-CSharp.dll.

Example
void OnLootEntityEnd(BasePlayer player, ItemBasedFlowRestrictor self)
{
    Puts("OnLootEntityEnd was called!");
}
  • Called when the player starts looting an item.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PlayerLoot.StartLootingItem of Assembly-CSharp.dll.

Example
void OnLootItem(PlayerLoot self, Item item)
{
    Puts("OnLootItem was called!");
}
  • Called when a player is trying to loot a container or a container they are looting has changed its contents.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PlayerLoot.SendUpdate of Assembly-CSharp.dll.

Example
object OnLootNetworkUpdate(PlayerLoot self)
{
    Puts("OnLootNetworkUpdate was called!");
    return (object) null;
}
  • Called when the player starts looting another player.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.RPC_LootPlayer of Assembly-CSharp.dll.

Example
void OnLootPlayer(BasePlayer self, BasePlayer local0)
{
    Puts("OnLootPlayer was called!");
}
  • Called when trying to add a marker.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.Server_AddMarker of Assembly-CSharp.dll.

Example
object OnMapMarkerAdd()
{
    Puts("OnMapMarkerAdd was called!");
    return (object) null;
}
  • Called after a marker was added.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.Server_AddMarker of Assembly-CSharp.dll.

Example
void OnMapMarkerAdded(BasePlayer self, ProtoBuf.MapNote local0)
{
    Puts("OnMapMarkerAdded was called!");
}

This hook requires OnMapMarkerAdd, which loads alongside OnMapMarkerAdded.

  • Called when trying to remove a marker.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.Server_RemovePointOfInterest of Assembly-CSharp.dll.

Example
object OnMapMarkerRemove(BasePlayer self, BasePlayer self1, int local0)
{
    Puts("OnMapMarkerRemove was called!");
    return (object) null;
}
  • Called when trying to clear map markers.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.Server_ClearMapMarkers of Assembly-CSharp.dll.

Example
object OnMapMarkersClear(BasePlayer self, BasePlayer self1)
{
    Puts("OnMapMarkersClear was called!");
    return (object) null;
}
  • Called after markers were cleared.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.Server_ClearMapMarkers of Assembly-CSharp.dll.

Example
void OnMapMarkersCleared(BasePlayer self)
{
    Puts("OnMapMarkersCleared was called!");
}

This hook requires OnMapMarkersClear, which loads alongside OnMapMarkersCleared.

  • Useful for canceling melee attacks.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseMelee.PlayerAttack of Assembly-CSharp.dll.

Example
object OnMeleeAttack(BasePlayer local0, HitInfo local3)
{
    Puts("OnMeleeAttack was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is Carbon-only compatible.

  • Patches BaseMetalDetector.RPC_RequestFlag of Assembly-CSharp.dll.

Example
void OnMetalDetectorFlagRequest(BaseMetalDetector self, UnityEngine.Vector3 local1, BasePlayer local0)
{
    Puts("OnMetalDetectorFlagRequest was called!");
}
  • Called when a player is paying for placement. Useful for preventing paying for placing deployables, building blocks and etc.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches Planner.PayForPlacement of Assembly-CSharp.dll.

Example
object OnPayForPlacement(BasePlayer player, Planner self, Construction component)
{
    Puts("OnPayForPlacement was called!");
    return (object) null;
}
  • Called when player is paying for an upgrade. Useful for preventing paying for block upgrade.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BuildingBlock.PayForUpgrade of Assembly-CSharp.dll.

Example
object OnPayForUpgrade(BasePlayer player, BuildingBlock self, ConstructionGrade g)
{
    Puts("OnPayForUpgrade was called!");
    return (object) null;
}
  • Called after a player consumes an item such as tea that is about to apply modifiers.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ItemModConsume.DoAction of Assembly-CSharp.dll.

Example
object OnPlayerAddModifiers()
{
    Puts("OnPlayerAddModifiers was called!");
    return (object) null;
}
  • Called when a player tries to assist target player (when target is wounded).

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.RPC_Assist of Assembly-CSharp.dll.

Example
object OnPlayerAssist(BasePlayer self, BasePlayer player)
{
    Puts("OnPlayerAssist was called!");
    return (object) null;
}
  • Useful for modifying an attack before it goes out.

  • hitInfo.HitEntity should be the entity that this attack would hit.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseMelee.DoAttackShared of Assembly-CSharp.dll.

Example
object OnPlayerAttack(BaseMelee self, HitInfo info)
{
    Puts("OnPlayerAttack was called!");
    return (object) null;
}
  • Useful for modifying an attack before it goes out.

  • hitInfo.HitEntity should be the entity that this attack would hit.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.OnProjectileAttack of Assembly-CSharp.dll.

Example
object OnPlayerAttack(BasePlayer self, HitInfo local2)
{
    Puts("OnPlayerAttack was called!");
    return (object) null;
}
  • Called when the player is banned (Facepunch, EAC, server ban, etc.).

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches EACServer.OnClientActionRequired of Assembly-CSharp.dll.

Example
void OnPlayerBanned(Network.Connection local2, string toString())
{
    Puts("OnPlayerBanned was called!");
}
  • Gets called when a connection gets banned.

  • Called when the player is banned (Facepunch, EAC, server ban, etc.).

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CorePlugin.IOnPlayerBanned.

Example
void OnPlayerBanned(Network.Connection connection, string reason)
{
    Puts("OnPlayerBanned was called!");
}
  • Gets called when a player sends a chat message.

  • Called when the player sends chat to the server.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CorePlugin.IOnPlayerChat.

Example
void OnPlayerChat(BasePlayer player, string message, ConVar.Chat.ChatChannel channel)
{
    Puts("OnPlayerChat was called!");
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.EnablePlayerCollider of Assembly-CSharp.dll.

Example
object OnPlayerColliderEnable(BasePlayer self, BasePlayer self1)
{
    Puts("OnPlayerColliderEnable was called!");
    return (object) null;
}
  • Called after the player object is created, but before the player has spawned.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CorePlugin.IOnPlayerConnected.

Example
void OnPlayerConnected(BasePlayer player)
{
    Puts("OnPlayerConnected was called!");
}
  • Called when a non-null corpse is about to spawn.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.CreateCorpse of Assembly-CSharp.dll.

Example
object OnPlayerCorpseSpawn()
{
    Puts("OnPlayerCorpseSpawn was called!");
    return (object) null;
}
  • Called when a non-null corpse has just been spawned.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.CreateCorpse of Assembly-CSharp.dll.

Example
void OnPlayerCorpseSpawned(BasePlayer self, PlayerCorpse local3)
{
    Puts("OnPlayerCorpseSpawned was called!");
}

This hook requires OnPlayerCorpseSpawn, which loads alongside OnPlayerCorpseSpawned.

  • Called when the player is about to die.

  • HitInfo may be null sometimes.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.Die of Assembly-CSharp.dll.

Example
object OnPlayerDeath(BasePlayer self, HitInfo info)
{
    Puts("OnPlayerDeath was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is Carbon-only compatible.

  • Patches BaseDiggableEntity.Dig of Assembly-CSharp.dll.

Example
object OnPlayerDig(BasePlayer player, BaseDiggableEntity self)
{
    Puts("OnPlayerDig was called!");
    return (object) null;
}
  • Called after the player has disconnected from the server.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ServerMgr.OnDisconnected of Assembly-CSharp.dll.

Example
void OnPlayerDisconnected(BasePlayer local0, string strReason)
{
    Puts("OnPlayerDisconnected was called!");
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseMountable.RPC_WantsDismount of Assembly-CSharp.dll.

Example
void OnPlayerDismountFailed(BasePlayer local0, BaseMountable self)
{
    Puts("OnPlayerDismountFailed was called!");
}

This hook requires OnPlayerWantsDismount, which loads alongside OnPlayerDismountFailed.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches LiquidContainer.SVDrink of Assembly-CSharp.dll.

Example
object OnPlayerDrink(BasePlayer player, LiquidContainer self)
{
    Puts("OnPlayerDrink was called!");
    return (object) null;
}
  • Called when the player drops their active held item.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PlayerBelt.DropActive of Assembly-CSharp.dll.

Example
object OnPlayerDropActiveItem(PlayerBelt self, Item local0)
{
    Puts("OnPlayerDropActiveItem was called!");
    return (object) null;
}
  • Called just before the player's health changes.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.OnHealthChanged of Assembly-CSharp.dll.

Example
object OnPlayerHealthChange(BasePlayer self, float oldvalue, float newvalue)
{
    Puts("OnPlayerHealthChange was called!");
    return (object) null;
}
  • Called when input is received from a connected client.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.OnReceiveTick of Assembly-CSharp.dll.

Example
object OnPlayerInput(BasePlayer self, BasePlayer self1)
{
    Puts("OnPlayerInput was called!");
    return (object) null;
}

This hook requires OnPlayerTick, which loads alongside OnPlayerInput.

  • Called before a player is kept alive (Example: You started "helping" player, it keeps him alive for at least 10 seconds more to be sure he won't die until you finish picking him up).

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.RPC_KeepAlive of Assembly-CSharp.dll.

Example
object OnPlayerKeepAlive(BasePlayer self, BasePlayer player)
{
    Puts("OnPlayerKeepAlive was called!");
    return (object) null;
}
  • Called after the player is kicked from the server.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.Kick of Assembly-CSharp.dll.

Example
void OnPlayerKicked(BasePlayer self)
{
    Puts("OnPlayerKicked was called!");
}
  • Called after the player is kicked from the server.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches EACServer.OnClientActionRequired of Assembly-CSharp.dll.

Example
void OnPlayerKicked(Network.Connection local2, string toString())
{
    Puts("OnPlayerKicked was called!");
}

This hook requires OnPlayerBanned [EAC], which loads alongside OnPlayerKicked.

  • Called just before the player lands on the ground.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.ApplyFallDamageFromVelocity of Assembly-CSharp.dll.

Example
object OnPlayerLand(BasePlayer self, float local0)
{
    Puts("OnPlayerLand was called!");
    return (object) null;
}
  • Called when the player landed on the ground.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.ApplyFallDamageFromVelocity of Assembly-CSharp.dll.

Example
void OnPlayerLanded(BasePlayer self, float local0)
{
    Puts("OnPlayerLanded was called!");
}

This hook requires OnPlayerLand, which loads alongside OnPlayerLanded.

  • Called when the player stops looting.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PlayerLoot.Clear of Assembly-CSharp.dll.

Example
void OnPlayerLootEnd(PlayerLoot self)
{
    Puts("OnPlayerLootEnd was called!");
}
  • Returning a non-null value cancels default behavior.

  • This hook is Carbon-only compatible.

  • Patches BasePlayer.SendMarkersToClient of Assembly-CSharp.dll.

Example
void OnPlayerMarkersSend(BasePlayer self, ProtoBuf.MapNoteList local0)
{
    Puts("OnPlayerMarkersSend was called!");
}
  • Called after the player's metabolism has been changed.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PlayerMetabolism.ServerUpdate of Assembly-CSharp.dll.

Example
void OnPlayerMetabolize(PlayerMetabolism self, BaseCombatEntity ownerEntity, float delta)
{
    Puts("OnPlayerMetabolize was called!");
}
  • Gets called when a player sends an offline chat message.

  • Returning a non-null value cancels default behavior.

  • This hook is Carbon-only compatible.

  • Patches CorePlugin.OnPlayerOfflineChat.

Example
void OnPlayerOfflineChat(ulong playerid, string username, string message, ConVar.Chat.ChatChannel channel)
{
    Puts("OnPlayerOfflineChat was called!");
}
  • Returning a non-null value cancels default behavior.

  • This hook is Carbon-only compatible.

  • Patches BasePlayer.SendPingsToClient of Assembly-CSharp.dll.

Example
void OnPlayerPingsSend(BasePlayer self, ProtoBuf.MapNoteList local0)
{
    Puts("OnPlayerPingsSend was called!");
}
  • Called when the player is about to recover from the 'wounded' state.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.RecoverFromWounded of Assembly-CSharp.dll.

Example
object OnPlayerRecover(BasePlayer self)
{
    Puts("OnPlayerRecover was called!");
    return (object) null;
}
  • Called when the player was recovered.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.RecoverFromWounded of Assembly-CSharp.dll.

Example
void OnPlayerRecovered(BasePlayer self)
{
    Puts("OnPlayerRecovered was called!");
}

This hook requires OnPlayerRecover, which loads alongside OnPlayerRecovered.

  • Called when a player has reported someone via F7.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.OnPlayerReported of Assembly-CSharp.dll.

Example
void OnPlayerReported(BasePlayer self, string local4, string local3, string local0, string local1, string local2)
{
    Puts("OnPlayerReported was called!");
}
  • Called when a player is attempting to respawn.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.Respawn of Assembly-CSharp.dll.

Example
void OnPlayerRespawn(BasePlayer player, BasePlayer.SpawnPoint spawnPoint)
{
    Puts("OnPlayerRespawn was called!");
}
  • Called when a player is attempting to respawn.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches SleepingBag.SpawnPlayer of Assembly-CSharp.dll.

Example
void OnPlayerRespawn(BasePlayer player, BasePlayer.SpawnPoint spawnPoint)
{
    Puts("OnPlayerRespawn was called!");
}
  • Called when the player has respawned (specifically when they click the "Respawn" button).

  • ONLY called after the player has transitioned from dead to not-dead, so not when they're waking up.

  • This means it's possible for the player to connect and disconnect from a server without OnPlayerRespawned ever triggering for them.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.RespawnAt of Assembly-CSharp.dll.

Example
void OnPlayerRespawned(BasePlayer self)
{
    Puts("OnPlayerRespawned was called!");
}
  • Called before the recover after reviving with a medical tool.

  • Useful for canceling the reviving.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches MedicalTool.GiveEffectsTo of Assembly-CSharp.dll.

Example
object OnPlayerRevive(MedicalTool self, BasePlayer player)
{
    Puts("OnPlayerRevive was called!");
    return (object) null;
}

This hook requires OnHealingItemUse, which loads alongside OnPlayerRevive.

  • Called when setting player's information (aka console variables).

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ServerMgr.ClientReady of Assembly-CSharp.dll.

Example
void OnPlayerSetInfo(Network.Connection connection, string name, string value)
{
    Puts("OnPlayerSetInfo was called!");
}
  • Called when setting player's information (aka console variables).

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.SetInfo of Assembly-CSharp.dll.

Example
void OnPlayerSetInfo(BasePlayer self, string key, string val)
{
    Puts("OnPlayerSetInfo was called!");
}
  • Called when the player is about to go to sleep.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.StartSleeping of Assembly-CSharp.dll.

Example
void OnPlayerSleep(BasePlayer self)
{
    Puts("OnPlayerSleep was called!");
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.EndSleeping of Assembly-CSharp.dll.

Example
object OnPlayerSleepEnd(BasePlayer self)
{
    Puts("OnPlayerSleepEnd was called!");
    return (object) null;
}
  • Called when the player awakes.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.EndSleeping of Assembly-CSharp.dll.

Example
void OnPlayerSleepEnded(BasePlayer self)
{
    Puts("OnPlayerSleepEnded was called!");
}

This hook requires OnPlayerSleepEnd, which loads alongside OnPlayerSleepEnded.

  • Called when a player is attempting to spawn for the first time.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ServerMgr.SpawnNewPlayer of Assembly-CSharp.dll.

Example
object OnPlayerSpawn()
{
    Puts("OnPlayerSpawn was called!");
    return (object) null;
}
  • Called when the player starts spectating.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.StartSpectating of Assembly-CSharp.dll.

Example
object OnPlayerSpectate(BasePlayer self, BasePlayer self1)
{
    Puts("OnPlayerSpectate was called!");
    return (object) null;
}
  • Called when the player stops spectating.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.StopSpectating of Assembly-CSharp.dll.

Example
object OnPlayerSpectateEnd(BasePlayer self, BasePlayer self1)
{
    Puts("OnPlayerSpectateEnd was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ItemModStudyBlueprint.ServerCommand of Assembly-CSharp.dll.

Example
object OnPlayerStudyBlueprint(BasePlayer player, Item item)
{
    Puts("OnPlayerStudyBlueprint was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.OnReceiveTick of Assembly-CSharp.dll.

Example
object OnPlayerTick(BasePlayer self)
{
    Puts("OnPlayerTick was called!");
    return (object) null;
}
  • Called when the player triggers an anti-hack violation.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches AntiHack.AddViolation of Assembly-CSharp.dll.

Example
object OnPlayerViolation()
{
    Puts("OnPlayerViolation was called!");
    return (object) null;
}
  • Called when the player uses the in-game voice chat.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.OnReceivedVoice of Assembly-CSharp.dll.

Example
object OnPlayerVoice(BasePlayer self)
{
    Puts("OnPlayerVoice was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseMountable.RPC_WantsDismount of Assembly-CSharp.dll.

Example
object OnPlayerWantsDismount(BasePlayer local0, BaseMountable self)
{
    Puts("OnPlayerWantsDismount was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseMountable.WantsMount of Assembly-CSharp.dll.

Example
object OnPlayerWantsMount(BasePlayer player, BaseMountable self)
{
    Puts("OnPlayerWantsMount was called!");
    return (object) null;
}
  • Called when the player is about to go down to the 'wounded' state.

  • source might be null, check it before use.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.BecomeWounded of Assembly-CSharp.dll.

Example
object OnPlayerWound(BasePlayer self, HitInfo info)
{
    Puts("OnPlayerWound was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePortal.UsePortal of Assembly-CSharp.dll.

Example
object OnPortalUse(BasePlayer player, BasePortal self)
{
    Puts("OnPortalUse was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePortal.UsePortal of Assembly-CSharp.dll.

Example
void OnPortalUsed(BasePlayer player, BasePortal self)
{
    Puts("OnPortalUsed was called!");
}

This hook requires OnPortalUse, which loads alongside OnPortalUsed.

  • Called when a player is about to be sent respawn information.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.SendRespawnOptions of Assembly-CSharp.dll.

Example
void OnRespawnInformationGiven(BasePlayer self, System.Collections.Generic.List`1[[ProtoBuf.RespawnInformation.SpawnOptions, Rust.Data, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]] local0)
{
    Puts("OnRespawnInformationGiven was called!");
}
  • Called before a metabolism update occurs for the specified player.

  • Metabolism update consists of managing the player's temperature, health etc.

  • You can use this to turn off or change certain aspects of the metabolism, either by editing values before returning, or taking complete control of the method.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches PlayerMetabolism.RunMetabolism of Assembly-CSharp.dll.

Example
object OnRunPlayerMetabolism(PlayerMetabolism self)
{
    Puts("OnRunPlayerMetabolism was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.SendModelState of Assembly-CSharp.dll.

Example
object OnSendModelState()
{
    Puts("OnSendModelState was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BaseEntity.SignalBroadcast of Assembly-CSharp.dll.

Example
object OnSignalBroadcast()
{
    Puts("OnSignalBroadcast was called!");
    return (object) null;
}
  • Called when the player spins a spinner wheel.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches SpinnerWheel.RPC_Spin of Assembly-CSharp.dll.

Example
object OnSpinWheel(BasePlayer player, SpinnerWheel self)
{
    Puts("OnSpinWheel was called!");
    return (object) null;
}
  • Called when a player's threat level is about to be updated.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BasePlayer.EnsureUpdated of Assembly-CSharp.dll.

Example
object OnThreatLevelUpdate(BasePlayer self)
{
    Puts("OnThreatLevelUpdate was called!");
    return (object) null;
}
  • Gets called when a connection is or not approved to join the server.

  • Used by RustCore and abstracted into CanClientLogin.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CorePlugin.IOnUserApprove.

Example
void OnUserApprove(Network.Connection connection)
{
    Puts("OnUserApprove was called!");
}
  • Gets called when a connection is approved to join the server.

  • Called after a player is approved to connect to the server.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CorePlugin.IOnUserApprove.

Example
void OnUserApproved(string username, string userid, string ip)
{
    Puts("OnUserApproved was called!");
}
  • Gets called when a player sends a chat message.

  • Called when a player sends a chat message to the server.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CorePlugin.IOnPlayerChat.

Example
void OnUserChat(Oxide.Core.Libraries.Covalence.IPlayer player, string message)
{
    Puts("OnUserChat was called!");
}
  • Called after a player has been approved and has connected to the server.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CorePlugin.IOnPlayerConnected.

Example
void OnUserConnected(Oxide.Core.Libraries.Covalence.IPlayer player)
{
    Puts("OnUserConnected was called!");
}
  • Gets called when a covalence player gets kicked.

  • Called when a player has been kicked from the server.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CorePlugin.OnPlayerKicked.

Example
void OnUserKicked(Oxide.Core.Libraries.Covalence.IPlayer player, string reason)
{
    Puts("OnUserKicked was called!");
}
  • Gets called when a covalence player respawns.

  • Called when a player is respawning.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CorePlugin.OnPlayerRespawn.

Example
void OnUserRespawn(Oxide.Core.Libraries.Covalence.IPlayer player)
{
    Puts("OnUserRespawn was called!");
}
  • Gets called when a covalence player fully respawned.

  • Called after a player has respawned.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches CorePlugin.OnPlayerRespawned.

Example
void OnUserRespawned(Oxide.Core.Libraries.Covalence.IPlayer player)
{
    Puts("OnUserRespawned was called!");
}
  • Useful for preventing clearing wires.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches WireTool.AttemptClearSlot of Assembly-CSharp.dll.

Example
object OnWireClear(BasePlayer ply, IOEntity local0, int clearIndex)
{
    Puts("OnWireClear was called!");
    return (object) null;
}

This hook requires OnWireClear [patch], which loads alongside OnWireClear.

  • Useful for preventing a wire to connect.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches WireTool.RPC_MakeConnection of Assembly-CSharp.dll.

Example
object OnWireConnect(BasePlayer local0, BaseNetworkable local4, int local2, BaseNetworkable local6, int local3, System.Collections.Generic.List`1[[UnityEngine.Vector3, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]] linePoints)
{
    Puts("OnWireConnect was called!");
    return (object) null;
}

Last updated