Repository navigation
Getting Started
在开始之前,确认你的服务器符合以下条件:
- 一个 Bukkit / Spigot / Paper 服务端(推荐 Paper)。
- Java 17 或更高版本。
- 最新版的 HimDSL 插件 jar 文件。
Before starting, make sure your server meets these requirements:
- A Bukkit / Spigot / Paper server (Paper recommended).
- Java 17 or later.
- The latest HimDSL plugin jar.
安装只有三步:
- 把
HimDSL-x.y.z.jar放进服务器的plugins/目录。 - 重启服务器。
- 看到控制台输出
[HimDSL] HimDSL enabled.就说明安装成功。
第一次启动后,插件会自动创建 plugins/HimDSL/ 目录。所有脚本文件都放在这个目录里。
Installation takes three steps:
- Place
HimDSL-x.y.z.jarinto the server'splugins/directory. - Restart the server.
- Seeing
[HimDSL] HimDSL enabled.in the console means success.
On first launch, the plugin automatically creates the plugins/HimDSL/ folder. All scripts live there.
在 plugins/HimDSL/ 里新建一个文件,命名为 hello.himdsl,写入以下内容:
Create a new file named hello.himdsl inside plugins/HimDSL/, with the following content:
int main() {
runcmd("CONSOLE", "say Hello, HimDSL!");
}
这个脚本做的事情很简单:以控制台身份执行 /say Hello, HimDSL!,所有在线玩家都会看到这条广播。
This script is simple: it runs /say Hello, HimDSL! as the console, so every online player sees the broadcast.
在服务器控制台或以 OP 身份在游戏里执行:
Run from the server console, or in-game as an operator:
/himdsl run hello.himdsl
如果成功,你会看到 执行完成。 的提示,游戏内所有玩家收到广播。如果脚本有语法错误,命令会返回错误提示,并指出大致位置。
If successful, you see 执行完成。 and every online player receives the broadcast. If the script has a syntax error, the command returns an error with a rough location.
HimDSL 目前提供三个子命令:
-
/himdsl compile <文件>—— 只检查语法,不执行。 -
/himdsl run <文件>—— 执行脚本。 -
/himdsl debug on|off—— 打开或关闭详细日志。
路径是相对于 plugins/HimDSL/ 的相对路径,例如 scripts/hello.himdsl。脚本文件必须放在这个目录里,插件不会执行目录之外的文件。
HimDSL currently offers three subcommands:
-
/himdsl compile <file>— syntax check only, no execution. -
/himdsl run <file>— execute the script. -
/himdsl debug on|off— toggle verbose logging.
Paths are relative to plugins/HimDSL/, for example scripts/hello.himdsl. Scripts must live inside this directory; the plugin will not execute files outside it.
如果你在 plugins/HimDSL/ 目录下创建名为 onServerLoad.himdsl 和 onServerShutdown.himdsl 的文件,插件会在服务器启动完成、以及插件关闭时自动运行它们。它们的写法与普通脚本完全一样,也以 main 作为入口。
If you create files named onServerLoad.himdsl and onServerShutdown.himdsl inside plugins/HimDSL/, the plugin runs them automatically when the server finishes loading, and when the plugin shuts down. Their structure is identical to ordinary scripts, with main as the entry point.
例如:
For example:
int main() {
runcmd("CONSOLE", "say 服务器已就绪。");
}
-
提示"文件不存在":检查路径是否相对于
plugins/HimDSL/,注意大小写。 -
提示"文件路径必须在插件目录内":说明路径指向了插件目录之外,把脚本移回
plugins/HimDSL/里。 -
**命令没反应:确认执行者拥有对应权限(himdsl.use / himdsl.run / himdsl.debug),或没有被权限插件拦截。
-
控制台没有 "HimDSL enabled.":jar 未加载。检查服务端版本、Java 版本是否匹配,查看
logs/latest.log。 -
"File not found": check the path is relative to
plugins/HimDSL/; mind case sensitivity. -
"Path must be inside the plugin directory": move the script back into
plugins/HimDSL/. -
Command does nothing: confirm the executor has the matching permission (himdsl.use / himdsl.run / himdsl.debug), or isn't blocked by a permissions plugin.
-
No "HimDSL enabled." in console: the jar did not load. Verify server and Java versions; check
logs/latest.log.
现在你已经装好插件,也跑通了第一个脚本。接下来请翻到 [第一个脚本 / First-Script],我们会写一个能读取玩家数据、并根据数据做出反应的脚本。
You've installed the plugin and run your first script. Turn to [第一个脚本 / First-Script], where we write a script that reads player data and reacts to it.
- 首页 / Home
- 安装与快速开始 / Installation & Quick Start
- 第一个脚本 / Your First Script
- 命令速查 / Command Reference
- 自动执行脚本 / Auto-run Scripts
- 定义函数 / Defining Functions
- 函数重载 / Function Overloading
- Lambda 表达式 / Lambda Expressions
- 函数式接口 / Functional Interfaces
- 选择器总览 / Selectors Overview
- 选择器过滤器 / Selector Filters
- EntityRef 引用 / EntityRef
- 占位符参考 / Placeholders Reference
- PlaceholderAPI 桥接 / PAPI Bridge
- 创建 GUI / Creating a GUI
- GUISlot 槽位 / GUISlot
- 点击回调 / Click Callbacks
- onClose 回调 / onClose Callback
- GUI 刷新 / GUI Refresh
- 数学函数 / Math Built-ins
- 高精度计算 / BigDecimal Built-ins
- 字符串函数 / String Built-ins
- 集合函数 / Collection Built-ins
- 文件 I/O / File I/O
- 命令与 sleep / Commands & sleep