> For the complete documentation index, see [llms.txt](https://worldboxopenmods.gitbook.io/mod-tutorial-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://worldboxopenmods.gitbook.io/mod-tutorial-en/make-mod/commonothers.md).

# Others Common

If you want to modifies functions in game or do something before or after a function, you need `HarmonyPatch`

[Documentation](https://harmony.pardeike.net/articles/intro.html)

Using `HarmonyPrefix` to overwrite vanilla function is easy to do, but it may causes incompatible with other mods.

Here are two approaches to anesis it:

## HarmonyTranspiler

Insert IL code into methods to implement what you want. It has a learning cost, but is quite flexible and has a much more efficient runtime than `HarmonyPrefix`.

## Listener-Handler(Developing)

It is a feature provided by NML. Simply speaking, NML uses `HarmonyTranspiler` to implement `Listener`s listening to vanilla functions and call all registered and related `Handler` to handle the event.

NML also catches exceptions when `Handler` excuting. When the number of exceptions is greater than a certain value, the Handler will be deactivated to ensure the normal operation of the game.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://worldboxopenmods.gitbook.io/mod-tutorial-en/make-mod/commonothers.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
