# 一、前言

<figure><img src="https://m1.miaomc.cn/uploads/20230417_643cff378e4bd.png" alt=""><figcaption></figcaption></figure>

KubeJS是一个Minecraft模组，使你能够通过JavaScript来魔改游戏内容。随着Minecraft更新至1.19.2版本，KubeJS也迎来了一次大版本更新：KubeJS 6。其在事件监听方式上进行了很大的修改。这意味着原先的教程已经过时，可能对新手造成困难。

为了帮助大家了解KubeJS 6，本文将对其进行详细讲解。本文将会讲解KubeJS 6中的新事件监听系统，以及其他的相关内容。通过学习本文，你将能够快速上手KubeJS 6，并利用它来进行魔改。

该教程由[Wudji (github.com)](https://github.com/Wudji)编写，自MCBBS关站后，整理至Gitbook。

该教程的markdown源文件请见<https://github.com/Wudji/XPlus-KubeJS-Tutorial>

Wudji的爱发电链接：<https://afdian.net/a/Wudji_XPlusmodpack>

1.18.2-1.16.5教程见：<https://wudji.gitbook.io/xplus-kubejs-tutorial-v1-zh_cn/>

游戏版本：Minecraft 1.19.2。

模组加载器及其版本：Forge 43.1.47。

KubeJS版本：1902.6.0-build.103。

Architectury版本：6.3.49。

Rinho版本：1902.2.1-build.250。


---

# 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://wudji.gitbook.io/xplus-kubejs-tutorial-v2-zh_cn/readme.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.
