> For the complete documentation index, see [llms.txt](https://doc.stellarvan.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.stellarvan.cn/readme/kai-shi/huan-jing-zhun-bei.md).

# 环境准备

## 环境准备

先把本地开发环境配好。

教程默认使用 **Paper + Java + Maven + IntelliJ IDEA**。

### 你需要准备什么

* JDK 21
* IntelliJ IDEA
* Maven
* 一个本地 Paper 测试服

如果你的服务端版本较旧，Java 版本也要跟着对齐。

### 推荐目录结构

```
minecraft-plugin/
├─ server/
│  ├─ paper.jar
│  └─ plugins/
└─ hello-plugin/
```

把服务端和插件项目分开。 这样更容易调试和管理版本。

### 创建本地测试服

1. 新建一个 `server/` 目录。
2. 下载对应版本的 Paper 服务端。
3. 首次启动一次，生成配置文件。
4. 同意 `eula.txt`。
5. 后续把插件 jar 放进 `plugins/` 目录。

### 创建插件项目

你可以直接在 IntelliJ IDEA 里创建 Maven 项目。

建议使用这种包名：

```
com.yourname.pluginname
```

不要把主类放在默认包里。 这会让后续维护很麻烦。

### 开始前检查

在继续前，确认这几件事：

* 你能在 IDEA 里正常打开 Maven 项目
* 你能本地启动一次 Paper 服务器
* 你知道 `plugins/` 目录在哪
* 你知道构建后的 jar 在 `target/` 目录

{% hint style="warning" %}
不要依赖 `/reload` 做开发测试。 它经常留下错误状态，尤其是涉及任务、监听器和外部资源时。 重启测试服更稳。
{% endhint %}


---

# 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://doc.stellarvan.cn/readme/kai-shi/huan-jing-zhun-bei.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.
