跳到主要内容

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.APIMythicMobs 集成
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 动作速查表