All Projects → HeartAge → Minecraft_QQ-C-Server-

HeartAge / Minecraft_QQ-C-Server-

Licence: GPL-3.0 license
Minecraft服务器与QQ群互联

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to Minecraft QQ-C-Server-

HamsterAPI
Simple and easy to use API to read and write Packets.
Stars: ✭ 25 (+38.89%)
Mutual labels:  minecraft-plugin
LibertyBans
The be-all, end-all of discipline.
Stars: ✭ 92 (+411.11%)
Mutual labels:  minecraft-plugin
oraxen
Oraxen is a minecraft plugin that allows to easily use Minecraft 1.14 features in order to create new items with custom textures. It handles the resourcepack generation, upload (using Polymath) and has an extensible API.
Stars: ✭ 358 (+1888.89%)
Mutual labels:  minecraft-plugin
HeadsPlus
A heads plugin that has grown for over two years into something more ambitious than other plugins.
Stars: ✭ 35 (+94.44%)
Mutual labels:  minecraft-plugin
TabTPS
Minecraft server mod/plugin to monitor TPS, MSPT, and other information in the tab menu, boss bar, and action bar.
Stars: ✭ 151 (+738.89%)
Mutual labels:  minecraft-plugin
enjincraft
Minecraft plugin for integration with the Enjin Platform.
Stars: ✭ 57 (+216.67%)
Mutual labels:  minecraft-plugin
BetterSleeping
A Spigot plugin that will make sleeping on servers less of a hassle
Stars: ✭ 67 (+272.22%)
Mutual labels:  minecraft-plugin
EliteMobs
This is a spigot plugin that aims to extend Minecraft's survival endgame by making mobs more interesting.
Stars: ✭ 114 (+533.33%)
Mutual labels:  minecraft-plugin
NativeScreen
Spigot plugin that displays your desktop content and videos using Minecraft's maps.
Stars: ✭ 31 (+72.22%)
Mutual labels:  minecraft-plugin
LiteXLoader
This project has been merged into LiteLoaderBDS 👇 click below to new project 本项目已经合并到 LiteLoaderBDS 项目中 👇 点击前往 https://github.com/LiteLDev/LiteLoaderBDS
Stars: ✭ 84 (+366.67%)
Mutual labels:  minecraft-plugin
MinecraftBut
🎥 A Minecraft Plugin for youtubers such as BajanCandian, Skeppy, BadBoyHalo, A6D, Wilbur Soot
Stars: ✭ 50 (+177.78%)
Mutual labels:  minecraft-plugin
Minecraft-FPS-Hack
Are you lagging in Minecraft? Solve that with the Minecraft FPS hack!
Stars: ✭ 28 (+55.56%)
Mutual labels:  minecraft-plugin
OpenSectors
Powerful and easy to use sector system for Minecraft *OUTDATED*
Stars: ✭ 27 (+50%)
Mutual labels:  minecraft-plugin
grakkit
A modern JavaScript development environment for Minecraft.
Stars: ✭ 184 (+922.22%)
Mutual labels:  minecraft-plugin
CommandWhitelist
You decide what commands players can use or tab complete on your server!
Stars: ✭ 115 (+538.89%)
Mutual labels:  minecraft-plugin
MinecraftNOC
DevJam 2020: In-game NOC boards
Stars: ✭ 27 (+50%)
Mutual labels:  minecraft-plugin
MinetopiaVehicles
A realistic vehicle plugin for your Minecraft server!
Stars: ✭ 52 (+188.89%)
Mutual labels:  minecraft-plugin
ServerBasics
ServerBasics is essentials-like plugin with focus on performance and vanilla-like look.
Stars: ✭ 25 (+38.89%)
Mutual labels:  minecraft-plugin
Minecraft QQ
一个用于Minecraft服务器与QQ群互联的插件
Stars: ✭ 19 (+5.56%)
Mutual labels:  minecraft-plugin
MinecraftManhunt
Minecraft Bukkit plugin to run Manhunt minigames, with Discord music integration
Stars: ✭ 20 (+11.11%)
Mutual labels:  minecraft-plugin

Minecraft服务器与QQ群聊天的插件

Minecraft_QQ 插件本体(Cmd/Gui)

机器人使用ColorMirai
MCBBS帖子

连接说明

链接顺序不要搞错了
Minecraft_QQ->Minecraft_QQ_Cmd/Gui->ColorMirai
Minecraft_QQ->Minecraft_QQ_Cmd/Gui->ColorMirai
Minecraft_QQ->Minecraft_QQ_Cmd/Gui->ColorMirai
请不要拿Minecraft_QQ直连ColorMirai,连不上的

部署教程:

  1. 下载

ColorMirai
Minecraft_QQ_Cmd/Gui
Minecraft_QQ插件

  1. 安装

安装.Net 6
安装Java

  1. 启动

ColorMirai放到一个文件夹,根据步骤启动

Minecraft_QQ_Cmd/Gui放到一个文件夹,选择启动Cmd或者是Gui
Linux下使用

dotnet Minecraft_QQ_Cmd.dll

启动后进行第一次使用配置
连接ColorMirai

将插件放进服务器的插件文件夹 重启服务器
连接Minecraft_QQ_Cmd/Gui

第一次使用配置

  1. 群设置

Gui下,添加主群即可
有弹窗一样可以点主界面
右键就能修改/添加

Cmd下,打开Group.json调整配置

{
 "Groups": {
   "123456789": {
     "Group": "123456789",
     "EnableCommand": true,
     "EnableSay": true,
     "IsMain": true
   }
 }
}
  1. 运行QQ号设置

Gui修改插件配置下的机器人账户
Cmd修改MainConfig.json下的RobotSetting.QQ
填写运行的QQ号即可

  1. 保存重启

Cmd的配置文件修改后需要重启 Gui点右上角保存即可

配置文件

Ask.json
自动应答配置文件

{
 "AskList": {
   "服务器菜单": "服务器查询菜单:\r\n【#绑定: ID】可以绑定你的游戏ID。\r\n【#在线人数】可以查询服务器在线人数。\r\n【#服务器状态】可以查询服务器是否在运行。\r\n【#服务器: 内容】可以向服务器里发送消息。(使用前请确保已经绑定了ID,)"
 }
}

可以自行添加,注意json格式就行

{
 "AskList": {
   "a": "xxx",
  ......
   "b": "xxx"
 }
}

Command.json
自定义命令配置文件

{
 "CommandList": {
   "插件帮助": {
     "Command": "qq help",
     "PlayerUse": false,
     "PlayerSend": false,
     "Servers": []
   },
   "查钱": {
     "Command": "money {arg:name}",
     "PlayerUse": true,
     "PlayerSend": false,
     "Servers": []
   },
   "禁言": {
     "Command": "mute {arg1}",
     "PlayerUse": false,
     "PlayerSend": false,
     "Servers": []
   },
   "传送": {
     "Command": "tpa {arg:at}",
     "PlayerUse": true,
     "PlayerSend": false,
     "Servers": []
   },
   "给权限": {
     "Command": "lp user {arg:at} permission set {arg1} true",
     "PlayerUse": false,
     "PlayerSend": false,
     "Servers": []
   }
 }
}

命令可以自己添加,注意json格式

  • Command:发送到服务器的格式
  • PlayerUse:该命令是否非管理员可用
  • PlayerSend:命令执行是否是玩家
  • Servers:发送给的服务器,服务器名字记得加上"标起来

参数说明

  • {arg:at}:将会被替换为@QQ之后的游戏ID
  • {arg:name}:将会被替换为自己的游戏ID
  • {arg:qq}:将会被替换为自己的QQ
  • {arg:atqq}:将会被替换为@QQ之后的QQ
  • {arg[1\2\3\...]}:将会被替换为后面的参数
  • {argx}:将剩下的参数直接填进去 例如
"禁言": {
     "Command": "mute {arg1}",
     "PlayerUse": false,
     "PlayerSend": false,
     "Servers": []
}

在群里输入 #禁言 Color_yr 那么发送到服务器的指令为 mute Color_yr

"给权限": {
    "Command": "lp user {arg:at} permission set {arg1} true",
    "PlayerUse": false,
    "PlayerSend": false,
    "Servers": []
}

在群里输入 #给权限 @恋恋 admin.*(@一个群成员)
那么发送到服务器的指令为 lp user 该群员绑定的ID permission set admin.* true
参数注意空格,不注意会错乱

"说话": {
    "Command": "say {argx}",
    "PlayerUse": false,
    "PlayerSend": false,
    "Servers": []
}

在群里输入 #说话 test test
那么发送到服务器的指令为 say test test

Player.json玩家绑定储存

{
 "NotBindList": [
   "Color_yr",
   "id"
 ],
 "MuteList": [
   "playerid"
 ],
 "PlayerList": {
   "402067010": {
     "Name": "测试",
     "Nick": "昵称",
     "QQ": 402067010,
     "IsAdmin": true
   }
 }
}

自行添加注意格式

端口说明

ColorMirai的默认端口为23333
Minecraft_QQ_Cmd/Gui的默认端口为25555
如果没有必要,请不要随便改这两个端口

不在一台机器上部署

如果你有公网IP,直接在防火墙开放端口就行了
然后Minecraft_QQ的IP设置填你机器的公网IP 如果你没有公网IP,那就去用端口映射,能映射出去就行了
然后Minecraft_QQ_Cmd/Gui的绑定IP改为0.0.0.0

自己写Minecraft_QQ

  1. 首先确定你的环境是.net6

  2. 在你的项目里面导入Minecraft_QQ_Core.dll
    如果你导入的是ref文件夹里面的dll,请另外安装Newtonsoft.Json

  3. 核心启动
    首先设置回调,然后使用Start方法

private static void Message(string message)
{
    Console.WriteLine(message);
}
IMinecraft_QQ IMinecraft_QQ = new();
IMinecraft_QQ.ShowMessageCall = new IMinecraft_QQ.ShowMessage(Message);
IMinecraft_QQ.LogCall = new IMinecraft_QQ.Log(Message);
IMinecraft_QQ.Start();

获取核心

Minecraft_QQ Minecraft_QQ = IMinecraft_QQ.Main;

获取核心后就获取一些东西

/// <summary>
/// 配置文件路径
/// </summary>
public string Path { get; init; } = AppContext.BaseDirectory + "Minecraft_QQ/";
/// <summary>
/// Mysql启用
/// </summary>
public bool MysqlOK = false;
/// <summary>
/// 主群群号
/// </summary>
public long GroupSetMain { get; set; } = 0;
/// <summary>
/// 主配置文件
/// </summary>
public MainConfig MainConfig { get; set; }
/// <summary>
/// 玩家储存配置
/// </summary>
public PlayerConfig PlayerConfig { get; set; }
/// <summary>
/// 群储存配置
/// </summary>
public GroupConfig GroupConfig { get; set; }
/// <summary>
/// 自动应答储存
/// </summary>
public AskConfig AskConfig { get; set; }
/// <summary>
/// 自定义指令
/// </summary>
public CommandConfig CommandConfig { get; set; }

/// <summary>
/// Socket服务器
/// </summary>
public readonly MySocketServer Server;
/// <summary>
/// Mysql
/// </summary>
public readonly MyMysql Mysql;
/// <summary>
/// 机器人
/// </summary>
public readonly RobotSocket Robot;
/// <summary>
/// 发送群消息
/// </summary>
public readonly SendGroup SendGroup;

Minecraft_QQ核心方法API

/// <summary>
/// QQ号取玩家
/// </summary>
/// <param name="qq">qq号</param>
/// <returns>玩家信息</returns>
public PlayerObj GetPlayer(long qq);
/// <summary>
/// ID取玩家
/// </summary>
/// <param name="id">玩家ID</param>
/// <returns>玩家信息</returns>
public PlayerObj GetPlayer(string id);
/// <summary>
/// 设置玩家昵称
/// </summary>
/// <param name="qq">qq号</param>
/// <param name="nick">昵称</param>
public void SetNick(long qq, string nick);
/// <summary>
/// 设置玩家ID,如果存在直接修改,不存在创建
/// </summary>
/// <param name="qq">qq号</param>
/// <param name="name">玩家ID</param>
public void SetPlayerName(long qq, string name);
/// <summary>
/// 禁言玩家
/// </summary>
/// <param name="qq">QQ号</param>
public void MutePlayer(long qq);
/// <summary>
/// 禁言玩家
/// </summary>
/// <param name="name">名字</param>
public void MutePlayer(string name);
/// <summary>
/// 解除禁言
/// </summary>
/// <param name="qq">玩家QQ号</param>
public void UnmutePlayer(long qq);
/// <summary>
/// 解除禁言
/// </summary>
/// <param name="name">玩家ID</param>
public void UnmutePlayer(string name);
/// <summary>
/// 设置维护模式状态
/// </summary>
/// <param name="open">状态</param>
public void FixModeChange(bool open);
/// <summary>
/// 重载配置
/// </summary>
public bool Reload();
/// <summary>
/// 插件启动
/// </summary>
public void Start();
/// <summary>
/// 插件停止
/// </summary>
public void Stop();

具体内容看代码

如果你要通过Minecraft_QQ发送群消息,可以这样写

Minecraft_QQ.SendGroup.AddSend(new()
{
    Group = 123456,
    Message = "text"
});

又或者

Minecraft_QQ.Robot.SendGroupMessage(123456, "text");

推荐使用上面的方法,可以控制发送群消息的数量。

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].