问题 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

在线会员

  • Supper_Zero
  • colawzb
  • tuanzisama
  • 清风徐来
  • 完全
  • 啊啊啊害
  • 语吴伦次
  • Tears114
  • 九霄云境
  • hhhhGG
  • 刘氏影视传媒
  • littlelittlekai
  • 游戏红尘
  • musik
  • zhisxh
  • 一个不知名的网友
  • 黄 俊甯
  • Mirellata
  • 硬橘子
  • Deer4952
...和 10 更多。
后退
顶部 底部