powernukkitx-bundle / llse-lib Goto Github PK
View Code? Open in Web Editor NEW实现LLSE所有方法的库
License: MIT License
实现LLSE所有方法的库
License: MIT License
下面的例子当玩家破坏方块时会触发 2 遍 onDestroyBlock
import { mc } from '@LiteLoaderLibs/index.js';
export function main() {
mc.listen("onDestroyBlock", function (player, block) {
player.tell("破坏了"+block.type);
}
}
其它事件则不会。
可能是powernukkitx的问题?
PNX版本
18:09:25 [INFO ] 此服务器正在运行 Nukkit 1.20.0-r2 (git-914e68a3e) 版本 "PowerNu
kkitX" (API 1.0.14)
LLSELib版本 0.0.6
注册命令部分代码
const cmd = mc.newCommand("game", "生成", PermType.GameMasters);
cmd.setEnum('a', ['prepare']);
cmd.setEnum('e', ['start']);
cmd.setEnum('f', ['stop']);
cmd.setEnum('b', ['set']);
cmd.setEnum('d', ['xyz']);
cmd.setEnum('c', ['blue', 'red']);
cmd.setEnum('g', ['debug']);
cmd.setEnum('h', ['get']);
cmd.setEnum('i', ['clothes']);
cmd.setEnum('j', ['round']);
cmd.mandatory("action", ParamType.Enum, "a",'action', 1);
cmd.mandatory("op", ParamType.Enum, "b", 1);
cmd.mandatory("flag", ParamType.Enum, "c", 1);
cmd.mandatory("xyz", ParamType.Enum, "d", 1);
cmd.mandatory("start", ParamType.Enum, "e", 1);
cmd.mandatory("stop", ParamType.Enum, "f", 1);
cmd.mandatory("debug", ParamType.Enum, "g", 1);
cmd.mandatory("get", ParamType.Enum, "h", 1);
cmd.mandatory('clothes', ParamType.Enum, "i", 1);
cmd.mandatory('round', ParamType.Enum, "j", 1);
cmd.mandatory('radius', ParamType.Int);
cmd.overload(['debug', 'get', 'flag']);
cmd.overload(['debug', 'op', 'round', 'radius']);
cmd.overload(['action']);
cmd.overload(['start']);
cmd.overload(['stop']);
cmd.overload(['op', 'flag']);
cmd.overload(['op', 'xyz', 'flag']);
cmd.overload(['op', 'clothes', 'flag']);
cmd.setup();
cmd.setCallback((_cmd, ori, out, res) => {}
报错
Cannot invoke "org.graalvm.polyglot.Value.canExecute()" because "this.callback
" is null
at cn.nukkit.plugin.js.JSEventManager$CommandBuilder.register(JSEventMan
ager.java:325)
at setup(..@LLSELib\command\Command.js:281:11742-11772)
at main(index.js:341:10346-10356)
at org.graalvm.polyglot.Value.executeVoid(Value.java:900)
at cn.nukkit.plugin.CommonJSPlugin.onEnable(CommonJSPlugin.java:131)
at cn.nukkit.plugin.JSPluginLoader.enablePlugin(JSPluginLoader.java:68)
at cn.nukkit.plugin.PluginManager.enablePlugin(PluginManager.java:466)
at cn.nukkit.Server.enablePlugin(Server.java:1879)
at cn.nukkit.Server.enablePlugins(Server.java:1862)
at cn.nukkit.Server.(Server.java:953)
at cn.nukkit.Nukkit.main(Nukkit.java:160)
Caused by host exception: java.lang.NullPointerException: Cannot invoke "org.gra
alvm.polyglot.Value.canExecute()" because "this.callback" is null
想问一下大佬这是哪里的问题
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.