资源图标

资源 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"'
 

在线会员

  • wx321awa
  • 没烦恼
  • 七六
  • jja'k'k'l'l'j'l
  • 思左
  • 唯喵
  • ice_watermelon
  • Coquettishpig
  • 龙亚的游戏太空球
  • 涵筱
  • suphat060841
  • LCH
  • Kalpa
  • Marss
  • ou150654
  • kevin2025
  • Oracle-raven
  • 欣欣欣666
  • Relyonshe
后退
顶部 底部