问题 bds注册真命令后,非op玩家无法使用“tp”子命令

xuanyanLw

【Lv:3】

正式会员
注册
2022/10/02
消息
16
金粒
8,593.42金粒
我也是接触插件编写不久
遇到这个问题也不知道是哪了有问题,希望有大佬可以帮忙指出awa

这个是源码
//注册指令 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();
普通玩家视角:
1689068307245.jpg
1689068318800.jpg
可以看到没有显示子命令tp,二号图有这个命令但是就是不显示
op视角:
1689068388538.jpg
1689068393967.jpg
他就神奇的显示了..
 

附件

  • 1689068516207.jpg
    1689068516207.jpg
    89.5 KB · 查看: 3

在线会员

  • 嘟嘟嘟哒哒
  • gifgjjhdhj
  • Shepred_T
  • zcl
  • NineK
  • 故事也
  • wenjing
  • 咕噜Gulu
  • 爱玩游戏的谢飞
  • Andao_Lincoln
  • 苍空和龙
  • 超级刺客
  • 飞飞飞鱼
  • 119
  • kevin2025
  • 帝皇侠H
  • yeal
后退
顶部 底部