Skip to content

LumenContext API 总览

lumen 对象(惯例命名,也可叫 spark 兼容 sb3 写法)提供以下成员:

成员类型说明
lumen.loggerPrefixedLogger带子插件名前缀的日志器(info/warning/error/debug)
lumen.VERSIONstrLumenBridge 版本号
lumen.onBDSbool恒为 True(运行在 Endstone/BDS 上)
lumen.debugbool是否开启调试模式(读取主配置 debug 字段)
lumen.on(event, handler)method注册事件监听器
lumen.once(event, handler)method注册一次性事件监听器
lumen.off(event, handler)method移除事件监听器
lumen.emit(event, *args)method触发事件
lumen.QClientOneBotAdapterOneBot 适配器(发消息、调 API)
lumen.msgbuildermoduleOneBot 消息段构建器
lumen.packbuildermoduleOneBot action 包构建器
lumen.mcMCBridgeMinecraft 游戏接口桥
lumen.storageStorage子插件私有 JSON 存储
lumen.envEnvPool全局共享变量池
lumen.webWebBridgeWeb 扩展接口(配置表单/API/页面)
lumen.call_action(...)method通用 OneBot action 调用入口
lumen.register_regex_action(...)method向正则引擎注册自定义动作
lumen.run_on_main(func)method把函数调度到游戏主线程执行
lumen.endstonepropertyendstone 顶级模块透传
lumen.pluginpropertyLumenBridge 插件实例(endstone.plugin.Plugin)
lumen.serverpropertyEndstone Server 对象
lumen.schedulerpropertyEndstone 任务调度器
lumen.import_module(name)method按需导入任意 endstone 子模块
lumen.get_player(name)method获取在线玩家对象

基于 MIT 许可协议发布