- 注册
- 2022/10/02
- 消息
- 16
- 金粒
- 8,593.42金粒
我也是接触插件编写不久
遇到这个问题也不知道是哪了有问题,希望有大佬可以帮忙指出awa
这个是源码
普通玩家视角:


可以看到没有显示子命令tp,二号图有这个命令但是就是不显示
op视角:


他就神奇的显示了..
遇到这个问题也不知道是哪了有问题,希望有大佬可以帮忙指出
这个是源码
//注册指令
let xltp = mc.newCommand("xltp", "传送功能", PermType.Any);
xltp.setEnum("point", ["point"]);
xltp.setEnum("tpa", ["tpato", "tpahere"]);
xltp.setEnum("subCommand", ["add", "remove", "tp"])
xltp.setEnum("rtp", ["rtp"]);
xltp.setEnum("back", ["back"]);
xltp.optional("p", ParamType.Enum, "point");
xltp.optional("tp", ParamType.Enum, "tpa",);
xltp.mandatory("tp", ParamType.Enum, "subCommand");
xltp.optional("tp", ParamType.Enum, "back");
xltp.optional("tp", ParamType.Enum, "rtp");
xltp.overload(["tpa"]);
xltp.overload(["point", "subCommand"]);
xltp.overload(["rtp"]);
xltp.overload(["back"]);
//add remove rtp back tpato tpahere
xltp.setCallback((xltp, ori, out, res) => {
let pl = ori.player;
let n = 0;
let obj = {
"rtp": Rtp,
"back": Dtp,
"tpato": tpa,
"tpahere": tpa,
"add": addTp,
"remove": pt,
"tp": pt
}
if (res.tp == "tp" || res.tp == "tpahere") { n = 1; }
if (!obj[res.tp]) {
Mtp(pl);
}
else {
obj[res.tp](pl, n);
}
// log(res.p);
// log(res.tp);
// log(res.s);
});
xltp.setup();
普通玩家视角:


可以看到没有显示子命令tp,二号图有这个命令但是就是不显示
op视角:


他就神奇的显示了..
附件