Proxy server with built in bot not working #2434
Answered
by
rom1504
HumanDuck23
asked this question in
Q&A
Replies: 1 comment 8 replies
-
That would be cool to do. That has been discussed many times.
You will have to do many more changes
There is 2 sides you need to handle:
* Receiving packets by the Minecraft server: you need to make sure only one
position loop is sent by the proxy client (Minecraft client sends position
to the server every tick, either mineflayer either the vanilla client
should send them, not both)
* Receiving packets by the Minecraft client: you need to make sure all
information done by the bot is transmitted to the vanilla client somehow.
That will require extra hacking as in normal gameplay the server assumes
the client already knows where it is. In your case the client doesn't know,
so you would for example have to send teleport packet every time the
mineflayer bot moves
Movement is only one of the things that would need taking care of. Block
updates is another, and inventory is another.
This is a big project but I think it could be pretty cool.
Another way you can do at this is using prismarine-web-client which already
has mineflayer plugged in and which is an UI that allows controlling the
bot.
…On Fri, Jan 28, 2022, 06:51 HumanDuck23 ***@***.***> wrote:
I'm trying to make a proxy server with a bot built in. The user connects
to the proxy running on their localhost, which then connects them to a
server of their choice. This part works fine, I'm using the example script
https://github.com/PrismarineJS/node-minecraft-protocol/tree/master/examples/proxy.
What I want to add to this is a mineflayer bot. I want it to be able to
(for example) move as if the player was moving on their normal client. The
current issue I'm facing is that the user can't move properly (constant
lagbacks, if I try and fly I slowly get teleported all the way down every
few seconds). When I tell the bot to move It jumps forward every few
seconds instead of having smooth movement.
The only code I've added myself is this (after targetClient is created in
the example script)
bot = mineflayer.createBot({
client: targetClient})
This already prevents the user from playing normally, but I also can't
control the bot properly. Is it possible to do what I'm trying to do here?
—
Reply to this email directly, view it on GitHub
<#2434>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR437T2PAIKNOSA77NDFODUYIVHBANCNFSM5M73SGWQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
HumanDuck23
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to make a proxy server with a bot built in. The user connects to the proxy running on their localhost, which then connects them to a server of their choice. This part works fine, I'm using the example script https://github.com/PrismarineJS/node-minecraft-protocol/tree/master/examples/proxy. What I want to add to this is a mineflayer bot. I want it to be able to (for example) move as if the player was moving on their normal client. The current issue I'm facing is that the user can't move properly (constant lagbacks, if I try and fly I slowly get teleported all the way down every few seconds). When I tell the bot to move It jumps forward every few seconds instead of having smooth movement.
The only code I've added myself is this (after
targetClient
is created in the example script)This already prevents the user from playing normally, but I also can't control the bot properly. Is it possible to do what I'm trying to do here?
Beta Was this translation helpful? Give feedback.
All reactions