KetherModulesLite API
KetherModulesLite 对外提供了一组静态 API 入口,供其他插件在编译期依赖并调用。
依赖配置
从售后群获取 KetherModulesLite-api.jar 文件,放入项目的 libs/ 目录:
// build.gradle.kts
dependencies {
compileOnly(files("libs/KetherModulesLite-api.jar"))
}
在 plugin.yml 中声明软依赖:
softdepend:
- KetherModulesLite
包路径
所有 API 均位于 kim.hhhhhy.kethermodule.api 包下。
API 入口一览
| 入口对象 | 说明 | 文档 |
|---|---|---|
BlockAPI.API | 方块设置与方块发包 | BlockAPI |
DropAPI.DropItem.API | 按物品库 ID 掉落物品 | DropAPI |
DropAPI.ExpballDrop.API | 经验球掉落 | DropAPI |
FileAPI.API | 外部导入方块交互配置 | FileAPI |
HologramAPI.API | 全息文字显示(依赖 Adyeshach) | HologramAPI |
MythicAPI.API | MythicMobs 集成 | — |
WorldBorderAPI.API | 世界边界操作 | — |
基本用法
import kim.hhhhhy.kethermodule.api.BlockAPI
import kim.hhhhhy.kethermodule.api.DropAPI
// 设置方块
BlockAPI.API.setBlock(location, Material.STONE)
// 掉落物品
DropAPI.DropItem.API.drop("my_item", location, 1)
提示
除 API 调用外,KetherModulesLite 还提供了大量 Kether 脚本动作,详见 Kether 动作速查表。