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!");