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.1.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.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nonebot_plugin_mcqq_server-1.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 02bf9e5cf620a64d1a83b90749d3c945d70b04aee4ef0803281f08f11c3f2b43
MD5 9c9fdffb04d198fd9f8741880e882217
BLAKE2b-256 d8010492c9b63fd0cb775aad90661ae63d4bab907d2e8d5be8e18f29791b616c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_mcqq_server-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 baa5d32a4d62189b4aa3ca2c17fa7fa04f79122e81d2408ac04226c3d6588cb0
MD5 e6927adfceed68db30f8fbebc041352e
BLAKE2b-256 88847a348ab488efb1707bc59e19bfa059002fd06320cd4d1c42f1bad5e541d3

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