Player (169)

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 BasePlayer , SleepingBag SleepingBag , ulong UInt64 )
{
    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 BaseCombatEntity , AutoTurret AutoTurret )
{
    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 BaseCombatEntity , HelicopterTurret HelicopterTurret )
{
    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 BasePlayer , FlameTurret FlameTurret )
{
    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 BasePlayer , GunTrap GunTrap )
{
    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
void CanBeTargeted()
{
    Puts("CanBeTargeted [patch] was called!");
}

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
void CanBeTargeted()
{
    Puts("CanBeTargeted [patch] was called!");
}

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 BasePlayer )
{
    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 BasePlayer , CodeLock CodeLock , string String , bool Boolean )
{
    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 BasePlayer , BaseMountable BaseMountable )
{
    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 BasePlayer )
{
    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 BasePlayer , HackableLockedCrate HackableLockedCrate )
{
    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 BasePlayer , StashContainer StashContainer )
{
    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 BasePlayer , CodeLock CodeLock )
{
    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 BasePlayer , KeyLock KeyLock )
{
    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 BasePlayer , LootableCorpse LootableCorpse )
{
    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
void CanLootEntity()
{
    Puts("CanLootEntity was called!");
}
  • 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 BasePlayer , ResourceContainer ResourceContainer )
{
    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 BasePlayer , DroppedItemContainer DroppedItemContainer )
{
    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 BasePlayer , BaseRidableAnimal BaseRidableAnimal )
{
    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
void CanLootEntity()
{
    Puts("CanLootEntity was called!");
}
  • 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
void CanLootEntity()
{
    Puts("CanLootEntity was called!");
}
  • 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 BasePlayer )
{
    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 BasePlayer , BaseMountable BaseMountable )
{
    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 BasePlayer )
{
    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 BasePlayer , BaseCombatEntity BaseCombatEntity )
{
    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 BasePlayer , BaseLock BaseLock )
{
    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 BasePlayer )
{
    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 BasePlayer , SleepingBag SleepingBag , string String )
{
    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 BasePlayer , Item Item )
{
    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 BasePlayer , SleepingBag SleepingBag )
{
    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 BasePlayer , BasePlayer BasePlayer , RelationshipManager.RelationshipType RelationshipType , int Int32 )
{
    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 BasePlayer , string String )
{
    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 BasePlayer , BaseMountable BaseMountable )
{
    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 BasePlayer , ModularCarSeat ModularCarSeat )
{
    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 BasePlayer , GrowableEntity GrowableEntity )
{
    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 BasePlayer , CodeLock CodeLock )
{
    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 BasePlayer , KeyLock KeyLock )
{
    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 BasePlayer , ModularCarCodeLock ModularCarCodeLock , string String )
{
    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 BasePlayer , Signage Signage )
{
    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 BasePlayer , PhotoFrame PhotoFrame )
{
    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 BasePlayer , CarvablePumpkin CarvablePumpkin )
{
    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 BasePlayer , GestureConfig GestureConfig )
{
    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 BasePlayer , HBHFSensor HBHFSensor )
{
    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 BasePlayer , CodeLock CodeLock )
{
    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 BasePlayer , CodeLock CodeLock )
{
    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 BasePlayer , KeyLock KeyLock )
{
    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 BasePlayer , KeyLock KeyLock )
{
    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 BasePlayer , Mailbox Mailbox )
{
    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 String , string String , string String )
{
    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 BasePlayer , Item Item , 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 BasePlayer , Item Item , Item Item )
{
    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 String )
{
    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 String )
{
    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 Connection , string String )
{
    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 Connection , BaseProjectile BaseProjectile , string String )
{
    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 PlayerInventory , Item Item , bool Boolean )
{
    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 PlayerInventory )
{
    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 PlayerInventory )
{
    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 String , BasePlayer BasePlayer )
{
    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 String , BasePlayer BasePlayer )
{
    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 BasePlayer , BasePlayer BasePlayer )
{
    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 BasePlayer , BasePlayer BasePlayer )
{
    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 BaseMountable )
{
    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 Workbench )
{
    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 Workbench )
{
    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 Workbench , BasePlayer BasePlayer )
{
    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 Workbench , BasePlayer BasePlayer )
{
    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 AttackEntity , BasePlayer BasePlayer , UnityEngine.Vector3 Vector3 , bool Boolean )
{
    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 BasePlayer , string String , string String , Facepunch.Models.ReportType ReportType )
{
    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 PlayerInventory , ItemContainer ItemContainer , ProtoBuf.UpdateItemContainer UpdateItemContainer , PlayerInventory.Type Type , PlayerInventory.NetworkInventoryMode NetworkInventoryMode )
{
    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 PlayerLoot , BaseEntity BaseEntity )
{
    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 BasePlayer , LootableCorpse LootableCorpse )
{
    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 BasePlayer , StorageContainer StorageContainer )
{
    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 BasePlayer , DroppedItemContainer DroppedItemContainer )
{
    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 BasePlayer , ContainerIOEntity ContainerIOEntity )
{
    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 BasePlayer , ItemBasedFlowRestrictor ItemBasedFlowRestrictor )
{
    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 PlayerLoot , 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 PlayerLoot )
{
    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 BasePlayer , BasePlayer BasePlayer )
{
    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
void OnMapMarkerAdd()
{
    Puts("OnMapMarkerAdd was called!");
}
  • 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 BasePlayer , ProtoBuf.MapNote MapNote )
{
    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 BasePlayer , BasePlayer BasePlayer , int Int32 )
{
    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 BasePlayer , BasePlayer BasePlayer )
{
    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 BasePlayer )
{
    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 BasePlayer , HitInfo HitInfo )
{
    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 BaseMetalDetector , UnityEngine.Vector3 Vector3 , BasePlayer BasePlayer )
{
    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 BasePlayer , Planner Planner , Construction Construction )
{
    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 BasePlayer , BuildingBlock BuildingBlock , ConstructionGrade ConstructionGrade )
{
    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
void OnPlayerAddModifiers()
{
    Puts("OnPlayerAddModifiers was called!");
}
  • 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 BasePlayer , BasePlayer BasePlayer )
{
    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 BaseMelee , HitInfo HitInfo )
{
    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 BasePlayer , HitInfo HitInfo )
{
    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 Connection , string String )
{
    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
<