资源图标

资源 Command Parser API 1.0.1

完成注册/登录后下载

Pneu Jai

【Lv:4】

注册
2020/04/23
消息
28
金粒
3,743.08金粒
Pneu Jai 提交新资源:

Command Parser API - Parses command string to JSON object 將命令字符串解析為JSON物件

只是一個API,不是寫插件的請無視

用法:
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:
parseCommand('give "that player"...

阅读关于此资源更多信息...
 
最后编辑:
这个怎么用呀(小白路过)

要有BDSJsRunner

例:
var 輸出 = parseCommand('say blahblahblah "hello world"');

輸出.raw 會給你 'say blahblahblah "hello world"'
輸出.method 會給你 'say'
輸出.args[0] 會給你 'blahblahblah'
輸出.args[1] 會給你 '"hellow world"'
 

在线会员

  • 2658104640
  • YUS2026
  • HYyy
  • sag"
  • acg17
  • gaoluo
  • RMLunaria
  • maxdows
  • Miko_Chisayo
  • 鱼饲料
  • yitian
  • zcl
  • skywood
  • 一个不知名的网友
  • 953296574
  • liubo520
  • 纸鸢kite
  • pouleng
  • 578495284
  • renjia2013
...和 2 更多。
后退
顶部 底部