# Hooks

The hook types mentioned below can be used to hook into specific parts of the game with callback functions.

`internal` hooks are only meant to be used internally. **Do not use them.** They are only included here for reference.

All of these hooks can be used via `gimhook.addHook` - Look at the API documentation for more information.

### require

Module: `parcel`\
Type: `internal` Callback arguments: `string` (name)\
Callback output: `Module | undefined` (not sure if this the real type name)

`require()` hooks are used to intercept and modify javascript modules used within Gimkit.

Don't use this in your mods, this isn't meant for that.

### message

Module: `game`\
Type: `external` Callback arguments: `string` (message type), `any` (data)\
Callback output: `boolean | undefined` (if the function returns true, other handlers are skipped)

Used for intercepting colyseus messages. **Currently broken.**

### join

Module: `game`\
Type: `external` Callback arguments: N/A\
Callback output: N/A

Used to allow mods to handle joining a game with custom code.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://gimhook.coder-gage.dev/creating-mods/hooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
