一个仅客户端的模组,为 Minecraft 添加 WebSocket 服务器,允许发送命令并接收响应,功能类似于 RCon。
用法:
默认情况下,模组会生成包含以下设置的配置文件:
-
enable_mod = true -
port = 8115
因此,将创建一个监听端口 8115 的 WebSocket 服务器。你只需使用偏好的 WebSocket 客户端连接到此服务器即可。
连接成功后,服务器将返回以下信息:
200:Welcome to LCon! Have fun! Don't forget to use prefixes with every message you send to me.
200:Valid prefixes:
200:[chat] - send message to Minecraft chat.
200:[message] - display message for player only.
200:[system] - display system message in chat (for player only).
200:[client] - execute client-side command.
200:[server] - execute server-side command.
201:ready.
服务器会在每条消息前附加状态码。这些代码与普通 HTTP 状态码非常相似:
-
200 - 正常消息 -
201 - 状态消息(成功) -
400 - 错误
你可以向服务器发送各种数据以执行特定操作,并从服务器获取回复消息。在 Minecraft 聊天中打印的每条消息都会回显给已连接的 WebSocket 客户端。因此,你的客户端应解析或忽略这些消息。
要向服务器发送内容,必须按照上述说明,在消息本身前添加有效的 prefix。发送不带有效前缀的消息将导致服务器返回带有相应状态码的错误。
Simple client-only mod that adds WebSocket server to Minecraft, which allows to send commands and receive answers almost like RCon does.
Usage:
By default mod creates a config with the following settings:
-
enable_mod = true -
port = 8115
So, a WebSocket server will be created listening on port 8115. All you have to do is connect to this server using your preferred WebSocket client.
After successful connection, server will respond back with the following information:
200:Welcome to LCon! Have fun! Don't forget to use prefixes with every message you send to me.
200:Valid prefixes:
200:[chat] - send message to Minecraft chat.
200:[message] - display message for player only.
200:[system] - display system message in chat (for player only).
200:[client] - execute client-side command.
200:[server] - execute server-side command.
201:ready.
Server prepends every message with the status code. They're pretty similar to regular HTTP status codes:
-
200 - normal message -
201 - status message (success) -
400 - error
Well, you may send various data to server to perform certain actions and get back messages from server. Every message that is printed in Minecraft chat will be echo'ed to connected WebSocket clients. So, your client should either parse or ignore them.
To send something to server, you must prepend the message itself with one of the valid prefixes as stated above. Sending message without valid prefix will result in error sent back with appropriate status code.
下载 LCon - 本地控制台访问
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 LCon - 本地控制台访问
下载 LCon - 本地控制台访问
下载 LCon - 本地控制台访问
下载 LCon - 本地控制台访问
下载 LCon - 本地控制台访问
1.20-1.0.4 的移植版本
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
模组
使用 JavaScript 编辑配方、添加自定义物品、编写世界事件!
模组
AE2:一款流行的自动化与存储模组
模组
那是什么?一个 Waila/Hwyla 的分支。
评论 0
登录后参与评分
还没有评论,来抢沙发吧