Rust Wiki

Revision Difference

Hooks#526551

<title>Hooks</title>⤶ ⤶ # What Is It⤶ ⤶ A `Hook` is a way for modding frameworks to call your mod's code every time a certain action happens. ⤶ ⤶ Some Hooks Are:⤶ ⤶ * When an Entity takes damage⤶ * When a Player picks up an item⤶ * When a door is opened me⤶ ⤶ ⤶ Some hooks control if an action should happen, some trigger after an action happens and some will do both.⤶ ⤶ #How Does It Work⤶ ⤶ A modding framework such as <page>Oxide</page> will insert their special `CallHook` functions throughout the Rust Server code.⤶ ⤶ A `CallHook` function will run any code in your plugin that:⤶ ⤶ * Matches the name of the hook⤶ * Has the same parameters as the hook⤶ ⤶