• MineBBS 第一期星光推广计划开始了!丰富的金粒奖励,还有现金大奖噢~【点我去看看】
Resource icon

Uncategorized Command Parser API 1.0.1

Source of resources
Original
Copyright link
#
Language
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\"]}}"]}
)
[LINE][/LINE]
例:
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);
});
[LINE][/LINE]
註:
No target selector support yet.
  • Like
Reactions: Mcayear and YYT
Author
Pneu Jai
Downloads
413
Views
1,699
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Pneu Jai

Share this resource

Latest updates

  1. Minor fixes

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