crpmax / mc-bots Goto Github PK
View Code? Open in Web Editor NEWA simple app used for stress testing Minecraft servers with bots
License: MIT License
A simple app used for stress testing Minecraft servers with bots
License: MIT License
Maybe add a function that allows users to customize or give a list of ids of the bots
Hello, I am trying to use this to stress test my server and every time I run it, I get the following error:
[10:55:45] INFO | Login failed: Invalid login session.
com.github.steveice10.mc.auth.exception.request.InvalidCredentialsException:
at com.github.steveice10.mc.auth.util.HTTP.checkForError(HTTP.java:97)
at com.github.steveice10.mc.auth.util.HTTP.makeRequest(HTTP.java:75)
at com.github.steveice10.mc.auth.service.SessionService.joinServer(SessionService.java:68)
at com.github.steveice10.mc.protocol.ClientListener.packetReceived(ClientListener.java:66)
at com.github.steveice10.packetlib.event.session.PacketReceivedEvent.call(PacketReceivedEvent.java:51)
at com.github.steveice10.packetlib.tcp.TcpSession.callEvent(TcpSession.java:149)
at com.github.steveice10.packetlib.tcp.TcpSession.channelRead0(TcpSession.java:364)
at com.github.steveice10.packetlib.tcp.TcpSession.channelRead0(TcpSession.java:36)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295)
at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295)
at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:321)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:295)
at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:355)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:363)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:829)
[10:55:45] INFO |
[10:55:45] INFO | Bot with MainListener removed
[10:55:45] ERROR | All bots disconnected, exiting
For context, I am running my server in a docker container with a custom port. I am able to connect to the server using the minecraft client but the bots refuse to connect to the server.
Initialized native services in: /root/.gradle/native
The client will now receive all logging from the daemon (pid: 586242). The daemon log file: /root/.gradle/daemon/6.4.1/daemon-586242.out.log
Starting 5th build in daemon [uptime: 5 mins 15.803 secs, performance: 97%, non-heap usage: 24% of 268,4 MB]
Using 3 worker leases.
Starting Build
Settings evaluated using settings file '/root/mc-bots/settings.gradle'.
Projects loaded. Root project using build file '/root/mc-bots/build.gradle'.
Included projects: [root project 'mc-bots']
> Configure project :
Evaluating root project 'mc-bots' using build file '/root/mc-bots/build.gradle'.
All projects evaluated.
Selected primary task 'build' from project :
Tasks to be executed: [task ':compileJava', task ':processResources', task ':classes', task ':jar', task ':assemble', task ':compileTestJava', task ':processTestResources', task ':testClasses', task ':test', task ':check', task ':build']
Tasks that were excluded: []
:compileJava (Thread[Execution worker for ':',5,main]) started.
> Task :compileJava FAILED
Caching disabled for task ':compileJava' because:
Build cache is disabled
Task ':compileJava' is not up-to-date because:
Task has failed previously.
The input changes require a full rebuild for incremental task ':compileJava'.
Full recompilation is required because no incremental change information is available. This is usually caused by clean builds or changing compiler arguments.
Compiling with JDK Java compiler API.
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/Bot.java:4: error: package com.github.steveice10.mc.protocol.packet.ingame.clientbound does not exist
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundLoginPacket;
^
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/Bot.java:5: error: package com.github.steveice10.mc.protocol.packet.ingame.serverbound does not exist
import com.github.steveice10.mc.protocol.packet.ingame.serverbound.ServerboundChatPacket;
^
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/MainListener.java:3: error: package com.github.steveice10.mc.protocol.packet.ingame.clientbound does not exist
import com.github.steveice10.mc.protocol.packet.ingame.clientbound.ClientboundChatPacket;
^
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/Bot.java:41: error: method does not override or implement a method from a supertype
@Override
^
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/Bot.java:43: error: cannot find symbol
if (packet instanceof ClientboundLoginPacket) {
^
symbol: class ClientboundLoginPacket
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/Bot.java:69: error: cannot find symbol
client.send(new ServerboundChatPacket(text));
^
symbol: class ServerboundChatPacket
location: class Bot
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/MainListener.java:11: error: MainListener is not abstract and does not override abstract method packetSent(PacketSentEvent) in SessionListener
public class MainListener implements SessionListener {
^
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/MainListener.java:17: error: method does not override or implement a method from a supertype
@Override
^
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/MainListener.java:19: error: cannot find symbol
if(packet instanceof ClientboundChatPacket) {
^
symbol: class ClientboundChatPacket
location: class MainListener
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/MainListener.java:20: error: cannot find symbol
Component message = ((ClientboundChatPacket) packet).getMessage();
^
symbol: class ClientboundChatPacket
location: class MainListener
/root/mc-bots/src/main/java/me/creepermaxcz/mcbots/MainListener.java:38: error: method does not override or implement a method from a supertype
@Override
^
11 errors
:compileJava (Thread[Execution worker for ':',5,main]) completed. Took 0.378 secs.
FAILURE: Build failed with an exception.```
Since bot control may be getting added, here's another cool feature related to that:
Whenever controlling a single bot, something I'd also like to see is to make that specific bot leave or rejoin the server.
A command like leave
or rejoin
would be fine, but since it can cause some misunderstandings, there should be a prefix for all bot commands. An example is !
. Commands would look like this: !ctrl
, !leave
and !rejoin
.
Autorejoin automatically rejoins if the bot gets kicked, and rejoin just rejoins by itself.
!leave
- All bots leave the server, or a single bot if controlling it with ctrl
!rejoin
- All bots leave the server (bot names may be saved to memory or to a temporary file), and they join back, unless only one is under control
Yeah, I know it's a lot, and this is my third suggestion, but I'm completely filled with them. I love this project and I'd love to support it.
If you don't mind, I'll keep posting suggestions until I'm out of them.
Where can i find the names file?
So I have used Java before I have the command and everything and proxies. I tested it on my own server, Nothing happened I checked command prompt and the proxies were working the accounts were being made although a few seconds later they 'disconnected' then the the command would end saying all bots disconnected.
Java -jar mc.jar -s (the ip) -p MCBOT_ -c 5 -t SOCKS4 -l socks4.txt -r
This is the command I used and 333 of the proxies were working.
And my java its the the on the latest version, and im using windows 10
The feature to only control a single bot would be really useful.
By typing in chat something like "ctrl BotName1", an user should only type commands/messages as that bot. Then, by typing "ctrl" without any arguments, it should control all bots again.
That's only what I imagine it would be like though. If you have any better ideas, use those.
This would also be really useful when testing features in the server while under stress.
I'd like to simulate 400 concurrent players on my test server for an issue with my plugin: kangarko/ChatControl-Red#1566 (comment)
I am using the following startup flag for bots to connect to BungeeCord:
java -jar -Xms8G -Xmx8G mc-bots-1.1.0.jar -s localhost:25577 -d 10 11 -r -x -c 400
Which results to around 100 bots connecting to the proxy before dropping off and stabilizing at around 20:
Why is that? Too little memory? I have a machine with 64gb at my disposal, how much RAM do you think I need to set?
But I do think that the dropoff is a bug, can you please have a look?
Thanks!
Matej
"Outdated server! I'm still on 1.18.2"
I recommend removing annotated parts such as
" //Log.info(Arrays.toString(message.getWith().toArray()));
//msg = String.format(msg, );
//return msg;
" which are completely useless here.
is it possible to give a bot a token? i dont know if there is a command or config file to do this
When I try to spam it says Please wait before reconnecting in new mc versions!
Hi, I'm running this locally (on the same machine as the server) with the following command:
java -jar mc-bots-1.1.0.jar -d 10 11 -s localhost:30067 -r -p BOT_ -c 1
I get the following output:
[00:58:28] INFO | IP: 127.0.0.1
[00:58:28] INFO | Port: 30067
[00:58:28] INFO | Count: 1
[00:58:28] INFO | Creating bot BOT_Zdeslava
[00:58:28] INFO | MainListener registered for: BOT_Zdeslava
[00:58:58] INFO |
[00:58:58] INFO | BOT_Zdeslava disconnected
[00:58:58] INFO | -> Connection closed.
[00:58:58] INFO |
[00:58:58] INFO | Bot with MainListener removed
[00:58:58] ERROR | All bots disconnected, exiting
My server logs are as follows:
[00:58:58] [Server thread/INFO]: com.mojang.authlib.GameProfile@42e3e93e[id=<null>,name=BOT_Zdeslava,properties={},legacy=false] (/127.0.0.1:46439) lost connection: Timed out
Am I doing something incorrect here? Maybe there is some config in my server that is causing problems but I'm not sure what that would be...
I've noticed that there is no way to change IPs when testing with those bots, so, can we have an switch to make bots disconnect right after conecting? My server limits to 3 connections through one IP.
And thanks for the awesome tool!
there's errors when the proxy is not working and the bot with the main listener never joins if the proxy is not working
i want stress test my server but that only join from my ip not from proxy. i setup a startup correctly using proxy. but not working
can give me some example?
https://pastebin.pl/view/b72032c4 i don't know what i do wrong
max bots is 1000
anything higher just wont join, no matter how long I wait
Is it possible to upgrade it to the new verison ?
please if u add it this would be the best mc server stress tool
mcprotocol lib 1.18.2 came out :D
https://github.com/GeyserMC/MCProtocolLib/releases/tag/1.18.2-1
Hi! I am working on a project in which I will be creating a localhost website with all the features that mcstorm.io provides. Since I am a developer of javascript I used mineflayer api, the worst drop back about that api is it doesn't support 1.19.2/1 right now. So, kindly tell me the possible way for making your bots do custom actions like moving . Thanks :)
Can this be used on 1.17 - 1.17.1? Thanks!
Download free socks4/5 proxy lists from github or other sources such as https://github.com/TheSpeedX/PROXY-List
Version change option
tittle
idek this crap and also who ever is gonna type the command for me the file is the latest and i have another question DO I NEED A PROXY if not im happy if so the idk how to do anything on here but i need someones help lol and i dont need instructions bc ive read EVERYTHING HERE im just need a command and a answer
Will there be 1.19 update?
me not open
Hello,
This program needs to adapt proxy support because it will help server owners when the test server has "connection-throttle"
please add support for 1.18 :)
After entering the server with the robot, enter the registration command but display "please enable chat" and "chat is disabled in the client". How can I turn it on
Whenever I kill the bots, they don't respawn, and they can't send any messages neither.
A feature where the bots could respawn automatically with a customizable time delay like on joining would be useful. Autorejoin too, if it kicks you by accident or by any reason.
Example of how it'd look (with arguments):
-ar 2000
- Automatically respawns with 2 second delay
-aj 3000
- Automatically rejoins with the same bot account in 3 seconds of being kicked
By the way, I'm just a beginner in coding, so I don't know why --nicks
has two dashes. I think because it's multiple characters? In that case, use --ar
and --aj
instead of -ar
and -aj
.
Again, just to clarify, that's only what I imagine it would be like though. If you have any better ideas, use those.
Would it be possible to update for 1.19 support.
The library has been updated; https://github.com/GeyserMC/MCProtocolLib/releases
So, i'm a developer for a little server me and my friends own and they don't know how to get the numeric ip for the server (goofy ahh hosting) so we want to use the domain of the server which looks something like this: xxxx.xxxx-xxxxxxxx.xx
There is a - in there which makes the program crash, any ideas on how i could implement myself that or just wait for an update?
how to be on 24 hours on the server??
I hope in the update tomorrow the bot can move whether it's forward or backward, etc., thank you
after gradlew or gradlew build show me this error. Please can you help me?
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Creating bot mYKjm2WEShJt1xIf
[22:20:55] INFO | MainListener registered for: mYKjm2WEShJt1xIf
[22:20:55] INFO |
[22:20:55] INFO | mYKjm2WEShJt1xIf disconnected
[22:20:55] INFO | -> com.github.steveice10.mc.protocol.data.UnexpectedEncryptionException: Cannot reply to ClientboundHelloPacket without profile and access token.
com.github.steveice10.mc.protocol.data.UnexpectedEncryptionException: Cannot reply to ClientboundHelloPacket without profile and access token.
at com.github.steveice10.mc.protocol.ClientListener.packetReceived(ClientListener.java:55)
at com.github.steveice10.packetlib.tcp.TcpSession.callPacketReceived(TcpSession.java:156)
at com.github.steveice10.packetlib.tcp.TcpSession.channelRead0(TcpSession.java:377)
at com.github.steveice10.packetlib.tcp.TcpSession.channelRead0(TcpSession.java:28)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)
at io.netty.handler.codec.ByteToMessageCodec.channelRead(ByteToMessageCodec.java:103)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
[22:20:55] INFO |
[22:20:55] INFO | Bot with MainListener removed
[22:20:55] ERROR | All bots disconnected, exiting
openjdk version and more?
The commit style is confusing, unclear and ugly, I would recommend using Semantic Commit Messages.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.