MCPcopy Index your code
hub / github.com/Nova-Committee/McBot

github.com/Nova-Committee/McBot @v2.3.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.3.0 ↗ · + Follow
222 symbols 547 edges 59 files 41 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img width="300" src="https://s2.loli.net/2022/10/02/zrebhtAKjc3GyIl.png" alt="title">

McBot

✨ Based on OneBot protocol's MineCraft QQ Robot✨


<a href="https://github.com/Nova-Committee/McBot/issues"><img src="https://img.shields.io/github/issues/Nova-Committee/Bot-Connect?style=flat" alt="issues" /></a>
<a href="https://www.curseforge.com/minecraft/mc-mods/botconnect">
    <img src="http://cf.way2muchnoise.eu/botconnect.svg" alt="CurseForge Download">
</a>
<img src="https://img.shields.io/badge/license-GPLV3-green" alt="License">
<a href="https://github.com/howmanybots/onebot"><img src="https://img.shields.io/badge/OneBot-v11-blue?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABABAMAAABYR2ztAAAAIVBMVEUAAAAAAAADAwMHBwceHh4UFBQNDQ0ZGRkoKCgvLy8iIiLWSdWYAAAAAXRSTlMAQObYZgAAAQVJREFUSMftlM0RgjAQhV+0ATYK6i1Xb+iMd0qgBEqgBEuwBOxU2QDKsjvojQPvkJ/ZL5sXkgWrFirK4MibYUdE3OR2nEpuKz1/q8CdNxNQgthZCXYVLjyoDQftaKuniHHWRnPh2GCUetR2/9HsMAXyUT4/3UHwtQT2AggSCGKeSAsFnxBIOuAggdh3AKTL7pDuCyABcMb0aQP7aM4AnAbc/wHwA5D2wDHTTe56gIIOUA/4YYV2e1sg713PXdZJAuncdZMAGkAukU9OAn40O849+0ornPwT93rphWF0mgAbauUrEOthlX8Zu7P5A6kZyKCJy75hhw1Mgr9RAUvX7A3csGqZegEdniCx30c3agAAAABJRU5ErkJggg=="></a>








<a href="https://github.com/Nova-Committee/McBot/raw/v2.3.0/README.md">简体中文</a> |
<a href="https://github.com/Nova-Committee/McBot/blob/all/README_EN.md#lts">LTS</a> |
<a href="https://github.com/Nova-Committee/McBot/blob/all/README_EN.md#quickstart">QuickStart</a>

LTS

Forge-all Fabric-all

QuickStart

Use api to request

public class TestCmd {
    public static ArgumentBuilder<CommandSourceStack, ?> register() {
        return Commands.literal("test")
                .executes(TestCmd::execute);
    }

    public static int execute(CommandContext<CommandSourceStack> context) throws CommandSyntaxException {
        System.out.println(McBot.bot.sendGroupMsg(337631140, MsgUtils.builder().text("1").build(), true));
        //send msg to group
        return 0;
    }
}

Event Listener Instance

public class WebSocketServerTest {
    public static void main(String[] args) throws Exception {
        public static LinkedBlockingQueue<String> blockingQueue = new LinkedBlockingQueue<>();//use queue
        public static Thread app = new Thread(() -> {
            service = new ConnectFactory(new BotConfig(), blockingQueue);//create websocket session
            bot = service.ws.createBot();//create bot instance
        }, "BotServer");
        app.start();
        EventBus bus = new EventBus(blockingQueue);//create bus
        GroupMessageListener groupMessageListener = new GroupMessageListener();
        groupMessageListener.addHandler("天气", new Handler<GroupMessageEvent>() {
            @Override
            public void handle(GroupMessageEvent groupMessage) {
                System.out.println(groupMessage);

            }
        });
        bus.addListener(groupMessageListener);//add listener
        bus.addListener(new SimpleListener<PrivateMessageEvent>() {//private chat listener
            @Override
            public void onMessage(PrivateMessageEvent privateMessage) {
                System.out.println(privateMessage);
            }
        });

    }
}

Client

McBot OneBot-v11 developed with standard protocols, compatible with all One Bot protocol clients that support forward Web sockets

Project Address Platform Authors Note
koishijs/koishi koishi shigma
onebot-walle/walle-q abrahum
Yiwen-Chan/OneBot-YaYa 先驱 kanri
richardchien/coolq-http-api CKYU richardchien Can be used by mirai-native
Mrs4s/go-cqhttp MiraiGo Mrs4s
yyuueexxiinngg/OneBot-Mirai Mirai yyuueexxiinngg
takayama-lily/onebot OICQ takayama

Credits

License

This product is licensed under the GNU General Public License version 3. The license is as published by the Free Software Foundation published at https://www.gnu.org/licenses/gpl-3.0.html.

Alternatively, this product is licensed under the GNU Lesser General Public License version 3 for non-commercial use. The license is as published by the Free Software Foundation published at https://www.gnu.org/licenses/lgpl-3.0.html.

Feel free to contact us if you have any questions about licensing or want to use the library in a commercial closed source product.

Thanks

Thanks JetBrains Provide Free License Support OpenSource Project

Stargazers over time

Stargazers over time

Extension points exported contracts — how you extend this code

IPlatformHelper (Interface)
(no doc) [2 implementers]
Common/src/main/java/cn/evole/mods/mcbot/platform/services/IPlatformHelper.java
AutoConfig (Interface)
@Project: McBot @Author: cnlimiter @CreateTime: 2024/8/13 01:12 @Description:
Common/src/main/java/cn/evole/mods/mcbot/api/config/AutoConfig.java
PlayerAdvancement (Interface)
(no doc) [1 implementers]
Common/src/main/java/cn/evole/mods/mcbot/api/event/server/ServerGameEvents.java
PlayerChat (Interface)
(no doc)
Common/src/main/java/cn/evole/mods/mcbot/api/event/mod/McBotEvents.java
EarlyPlayerChat (Interface)
(no doc)
Common/src/main/java/cn/evole/mods/mcbot/api/event/mod/McBotEvents.java

Core symbols most depended-on inside this repo

get
called by 98
Common/src/main/java/cn/evole/mods/mcbot/common/config/ModConfig.java
literal
called by 74
Common/src/main/java/cn/evole/mods/mcbot/core/event/ICmdEvent.java
argument
called by 22
Common/src/main/java/cn/evole/mods/mcbot/core/event/ICmdEvent.java
invoker
called by 12
Common/src/main/java/cn/evole/mods/mcbot/api/event/Event.java
register
called by 12
Common/src/main/java/cn/evole/mods/mcbot/api/event/Event.java
create
called by 11
Common/src/main/java/cn/evole/mods/mcbot/api/event/ToggleableEvent.java
sendGroupMsg
called by 7
Common/src/main/java/cn/evole/mods/mcbot/api/bot/BotApi.java
build
called by 7
Common/src/main/java/cn/evole/mods/mcbot/common/config/BotConfig.java

Shape

Method 154
Class 55
Interface 12
Enum 1

Languages

Java100%

Modules by API surface

Common/src/main/java/cn/evole/mods/mcbot/api/event/server/ServerGameEvents.java17 symbols
Forge/src/main/java/cn/evole/mods/mcbot/McBotForge.java13 symbols
Common/src/main/java/cn/evole/mods/mcbot/api/cmd/McBotCommandSource.java10 symbols
Common/src/main/java/cn/evole/mods/mcbot/common/command/SendCommand.java9 symbols
Common/src/main/java/cn/evole/mods/mcbot/core/event/IBotEvent.java8 symbols
Common/src/main/java/cn/evole/mods/mcbot/api/config/ConfigManager.java8 symbols
Common/src/main/java/cn/evole/mods/mcbot/platform/services/IPlatformHelper.java7 symbols
Common/src/main/java/cn/evole/mods/mcbot/api/event/ToggleableEvent.java7 symbols
Common/src/main/java/cn/evole/mods/mcbot/api/event/Event.java7 symbols
Forge/src/main/java/cn/evole/mods/mcbot/platform/ForgePlatformHelper.java6 symbols
Fabric/src/main/java/cn/evole/mods/mcbot/platform/FabricPlatformHelper.java6 symbols
Common/src/main/java/cn/evole/mods/mcbot/McBot.java6 symbols

For agents

$ claude mcp add McBot \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact