Skip to main content

采用本地读取 log 信息的方法的 Minecraft Server 消息互通插件。

Project description

NoneBotPluginLogo

NoneBotPluginText

Minecraft Server 消息互通

Minecraft Server 消息互通,采用本地读取 log 信息的方法。

python Poetry license pypi pypi download

机器人 bug 研究中心

安装

nb plugin install nonebot-plugin-mcqq-server

Bot 配置与服务端配置

  1. Bot 配置文件

在 nb 项目路径下找到 .env.prod 文件,添加以下内容

# Minecraft Server 消息互通
MCRCON_PASSWORD = "A"
MCRCON_PORT = 25575
MCS_LOG_PATH = "D:/MinecraftServer/logs/latest.log"
# 功能配置
MCS_GROUP_CMD = []
MCS_GROUP_LIST = ["724024810"] # QQ群
MCS_MC_CMD = []
MCS_MC_BROADCAST = '{"all":["724024810"]}'。

配置说明:

  • MCRCON_PASSWORD rcon 密码
  • MCRCON_PORT rcon 端口
  • MCS_LOG_PATH 服务端日志文件路径,精确到日志文件,为空则关闭广播。
  • MCS_GROUP_CMD 群转发触发命令,如果为空则将群聊消息全部转发至服务器。
  • MCS_GROUP_LIST 转发至服务器的群组列表
  • MCS_MC_CMD 服务器广播命令,如果为空则将服务器消息全部转发至群组。
  • MCS_MC_BROADCAST 广播分配配置,键是 Bot ID, 值是该 Bot 负责广播的群组列表

特别注意:当 MCS_MC_BROADCAST 的键为 all 时为单 bot 模式,此时插件会用第一个 bot 进行广播。如果键设置为 all 不可以设置其他 bot

  1. 服务端配置文件

在 MC 服务端文件的 server.properties 中开启 Rcon

# rcon
enable-rcon=true
rcon.password=1 # 设置rcon密码,与mcrcon_password一致。
rcon.port=25575 # 设置rcon端口,与mcrcon_port一致。

使用方法

在群内或游戏中发送信息即可使用。

超级管理员可使用 mcs指令 向服务器发送控制台指令。

例如 mcs指令 weather rain 相当于输入控制台指令 /weather rain

致谢

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_mcqq_server-1.1.4.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_mcqq_server-1.1.4-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_mcqq_server-1.1.4.tar.gz.

File metadata

  • Download URL: nonebot_plugin_mcqq_server-1.1.4.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.2 Windows/10

File hashes

Hashes for nonebot_plugin_mcqq_server-1.1.4.tar.gz
Algorithm Hash digest
SHA256 3b49c16df142a15d2a896bea09b0203006aacb95e210daa029e563c342c79dd3
MD5 c7ced2eae3d42252a2a513b5fecb1c73
BLAKE2b-256 028a85ee55591e53847a3a1ecc4e3783269fea9ef8a4d2ede41bdc22386638b3

See more details on using hashes here.

File details

Details for the file nonebot_plugin_mcqq_server-1.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_mcqq_server-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cade18124fad0c1f8eea5f52df7da050b275adf85e4e64deab524afe9858f866
MD5 d641a7a85f79eed10d2ce82e12326788
BLAKE2b-256 a4bbeb0190c27c451e8a9d6903c83769a9d4a89097cd9a2fe34a436ae4233abb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page