资源图标

JS插件 Command Parser API 1.0.1

登录后下载
资源类型
原创
版权链接
#
语言
English
用法:
getShareData("parseCommand")(commandRaw);
key: 命令字符串
(e.g.:
/give "that player" stone 1 0 {"can_place_on": {"blocks": ["grass", "air"]}}
)
output: JSON物件
(from e.g.:
{"raw":"/give \"that player\" stone 1 0 {\"can_place_on\": {\"blocks\": [\"grass\", \"air\"]}}","method":"give","args":["that player","stone","1","0","{\"can_place_on\": {\"blocks\": [\"grass\", \"air\"]}}"]}
)


例:
1. Static
JavaScript:
getShareData("parseCommand")('give "that player" stone 1 0 {"can_place_on": {"blocks": ["grass", "air"]}}');
2. Putting it in an event listener
JavaScript:
setBeforeActListener("onInputCommand", function (eventDataRaw) {
    let eventData = JSON.parse(eventDataRaw);
    eventData.command = getShareData("parseCommand")(eventData.cmd);
});


註:
No target selector support yet.
  • 喜欢
反馈: McayearYYT
作者
Pneu Jai
下载
119
阅读
901
首次发布
最后更新
评分
0.00 星 0 次评分

Pneu Jai的更多资源

最新更新

  1. Minor fixes

    -Removed quotes for quoted arguments -Now the function is saved into shared data