Structure (35)

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.

  • Useful for ignoring resource requirements for placement.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
object CanAffordToPlace(BasePlayer local0, Planner self, Construction component)
{
    Puts("CanAffordToPlace was called!");
    return (bool) null;
}
  • Called when the resources for an upgrade are checked.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
object CanAffordUpgrade(BasePlayer player, BuildingBlock self, BuildingGrade.Enum iGrade, ulong iSkin)
{
    Puts("CanAffordUpgrade was called!");
    return (bool) null;
}
  • Called when the player tries to build something.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
object CanBuild(Planner self, Construction local1, Construction.Target local3)
{
    Puts("CanBuild was called!");
    return (object) null;
}
  • Called when a player tries to change a building grade.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
object CanChangeGrade(BasePlayer player, BuildingBlock self, BuildingGrade.Enum iGrade, ulong iSkin)
{
    Puts("CanChangeGrade was called!");
    return (bool) null;
}
  • Called when a player tries to demolish a building block.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches StabilityEntity.CanDemolish of Assembly-CSharp.dll.

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

  • This hook is compatible within Carbon and Oxide.

  • Patches ServerBuildingManager.Merge of Assembly-CSharp.dll.

Example
void OnBuildingMerge(ServerBuildingManager self)
{
    Puts("OnBuildingMerge was called!");
}
  • Called when a building is split into two.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ServerBuildingManager.Split of Assembly-CSharp.dll.

Example
void OnBuildingSplit(BuildingManager.Building building, uint newID)
{
    Puts("OnBuildingSplit was called!");
}
  • 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
void OnCodeChanged(BasePlayer player, CodeLock self, string local0, bool local1)
{
    Puts("OnCodeChanged was called!");
}

This hook requires CanChangeCode, which loads alongside OnCodeChanged.

  • Called when the player has entered a code in a codelock.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
object OnCodeEntered(CodeLock self, BasePlayer player, string local0)
{
    Puts("OnCodeEntered was called!");
    return (object) null;
}
  • Called when a player tries to place a building block.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

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

  • This hook is Carbon-only compatible.

  • Patches BuildingPrivlidge.AddAuthorize of Assembly-CSharp.dll.

Example
object OnCupboardAssign(BuildingPrivlidge self, ulong local0, BasePlayer player)
{
    Puts("OnCupboardAssign was called!");
    return (object) null;
}

This hook requires OnCupboardAuthorize [BuildingPrivlidge], which loads alongside OnCupboardAssign.

  • Called when a cupboard attempts to authorize a player.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BuildingPrivlidge.AddAuthorize of Assembly-CSharp.dll.

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

This hook requires OnCupboardAuthorize [BuildingPrivlidge] [patch], which loads alongside OnCupboardAuthorize.

  • Called when a cupboard attempts to authorize a player.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches ItemModDeployable.OnDeployed of Assembly-CSharp.dll.

Example
object OnCupboardAuthorize(BuildingPrivlidge local0, BasePlayer player)
{
    Puts("OnCupboardAuthorize was called!");
    return (object) null;
}
  • Called when an attempt is made to clear a cupboard authorized list.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BuildingPrivlidge.ClearList of Assembly-CSharp.dll.

Example
object OnCupboardClearList(BuildingPrivlidge self, BasePlayer player)
{
    Puts("OnCupboardClearList was called!");
    return (object) null;
}
  • Called when a cupboard attempts to deauthorize a player.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches BuildingPrivlidge.RemoveSelfAuthorize of Assembly-CSharp.dll.

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

  • This hook is compatible within Carbon and Oxide.

  • Patches BuildingPrivlidge.GetProtectedMinutes of Assembly-CSharp.dll.

Example
void OnCupboardProtectionCalculated(BuildingPrivlidge self, BuildingPrivlidge self1)
{
    Puts("OnCupboardProtectionCalculated was called!");
}
  • Called when the player closed a door.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches Door.RPC_CloseDoor of Assembly-CSharp.dll.

Example
void OnDoorClosed(Door self, BasePlayer player)
{
    Puts("OnDoorClosed was called!");
}
  • Called when the player knocks on a door.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches Door.RPC_KnockDoor of Assembly-CSharp.dll.

Example
void OnDoorKnocked(Door self, BasePlayer player)
{
    Puts("OnDoorKnocked was called!");
}
  • Called when the player knocks on a door.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches DoorKnocker.Knock of Assembly-CSharp.dll.

Example
void OnDoorKnocked(DoorKnocker self)
{
    Puts("OnDoorKnocked was called!");
}
  • Called when the player opened a door.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches Door.RPC_OpenDoor of Assembly-CSharp.dll.

Example
void OnDoorOpened(Door self, BasePlayer player)
{
    Puts("OnDoorOpened was called!");
}
  • Called when any structure is built (walls, ceilings, stairs, etc.).

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
void OnEntityBuilt(Planner self, UnityEngine.GameObject local2)
{
    Puts("OnEntityBuilt was called!");
}
  • Called when the player has hit something with a hammer.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

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

  • This hook is compatible within Carbon and Oxide.

  • Patches Locker.RPC_Equip of Assembly-CSharp.dll.

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

  • This hook is Carbon-only compatible.

  • Patches PoweredLightsDeployer.AddPoint of Assembly-CSharp.dll.

Example
object OnPoweredLightsPointAdd(PoweredLightsDeployer self, BasePlayer local2, UnityEngine.Vector3 local0, UnityEngine.Vector3 local1)
{
    Puts("OnPoweredLightsPointAdd was called!");
    return (object) null;
}
  • Returning a non-null value cancels default behavior.

  • This hook is Carbon-only compatible.

  • Patches SignContent.CopyInfoToSign of Assembly-CSharp.dll.

Example
void OnSignContentCopied(SignContent self, ISignage s, IUGCBrowserEntity b)
{
    Puts("OnSignContentCopied was called!");
}
  • Called after the player has locked a sign or photo frame.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
void OnSignLocked(Signage self, BasePlayer player)
{
    Puts("OnSignLocked was called!");
}
  • Called after the player has locked a sign or photo frame.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
void OnSignLocked(PhotoFrame self, BasePlayer player)
{
    Puts("OnSignLocked was called!");
}
  • Called after the player has changed the text on a sign or updated a photo frame.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
void OnSignUpdated(Signage self, BasePlayer player, int local0)
{
    Puts("OnSignUpdated was called!");
}
  • Called after the player has changed the text on a sign or updated a photo frame.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
void OnSignUpdated(PhotoFrame self, BasePlayer player)
{
    Puts("OnSignUpdated was called!");
}
  • Called after the player has changed the text on a sign or updated a photo frame.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
void OnSignUpdated(CarvablePumpkin self, BasePlayer player)
{
    Puts("OnSignUpdated was called!");
}
  • Called when the player selects Demolish or DemolishImmediate from the BuildingBlock or BaseCombatEntity menu.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches StabilityEntity.DoImmediateDemolish of Assembly-CSharp.dll.

Example
object OnStructureDemolish(StabilityEntity self, BasePlayer player)
{
    Puts("OnStructureDemolish was called!");
    return (object) null;
}
  • Called when the player selects Demolish or DemolishImmediate from the BuildingBlock or BaseCombatEntity menu.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

  • Patches StabilityEntity.DoDemolish of Assembly-CSharp.dll.

Example
object OnStructureDemolish(StabilityEntity self, BasePlayer player)
{
    Puts("OnStructureDemolish was called!");
    return (object) null;
}
  • Called when the player repairs a BuildingBlock or BaseCombatEntity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
object OnStructureRepair(BaseCombatEntity self)
{
    Puts("OnStructureRepair was called!");
    return (object) null;
}
  • Called when the player rotates a BuildingBlock or BaseCombatEntity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
object OnStructureRotate(BuildingBlock self, BasePlayer player)
{
    Puts("OnStructureRotate was called!");
    return (object) null;
}
  • Called when the player upgrades the grade of a BuildingBlock or BaseCombatEntity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
object OnStructureUpgrade(BuildingBlock self, BasePlayer player, BuildingGrade.Enum type, ulong skin)
{
    Puts("OnStructureUpgrade was called!");
    return (object) null;
}
  • Called when the player upgrades the grade of a BuildingBlock or BaseCombatEntity.

  • Returning a non-null value cancels default behavior.

  • This hook is compatible within Carbon and Oxide.

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

Example
object OnStructureUpgrade(BuildingBlock self, BasePlayer player, BuildingGrade.Enum local0, ulong local1)
{
    Puts("OnStructureUpgrade was called!");
    return (object) null;
}

Last updated