GenerelSchwerz / 2Broke2Wait

7 stars 2 forks source link

Auto Respawn #4

Closed Hamstergg10 closed 1 year ago

GenerelSchwerz commented 1 year ago

I'll fix this in a few hours, try to leave a more detailed message about what occurred.

Hamstergg10 commented 1 year ago

Oh no, it was a suggestions lol

GenerelSchwerz commented 1 year ago

Oh sick, thanks!

That should already be implemented, you can change the config's "reconnectInterval" to determine how long the bot should wait until attempting to reconnect. The default is 10 seconds.

GenerelSchwerz commented 1 year ago

Wait, nevermind. I misread the title, lol.

Sure, I'm not entirely sure if that's possible, but I'll give it a whirl.

GenerelSchwerz commented 1 year ago

Looked into this a little more, sadly this is not possible with 2Broke2Wait (or any 2Bored2Wait derivative).

This is because the method we are using to proxy your connections is not tied to your client, meaning we do not have control over client-sided actions such as "clicking the respawn button". We can respawn on the server's end (by sending the client_command packet with payload 0), and in fact this happens by default with mineflayer, but the respawn menu does not go away on the client's side.

So if you mean "respawn on death on the server side", then yes this program already does that. You simply don't see it until you click the respawn button in your client.

GenerelSchwerz commented 1 year ago

EXTRA: My previous message has a misnomer. The bot will not respawn until you click respawn, if you are connected when the bot has died. Read further for suggestions.

That said, there might be some fixes I can add. If a person is connected to the proxy and they die, the bot does not take over (since that client is still linked). I am not sure if you/others would want a change for that (like the bot auto-respawning and beginning antiafk).

I experimented with sending the client_command packet regardless of the client being linked or not; it did spawn the bot on the server’s side, but the menu did not go away.

GenerelSchwerz commented 1 year ago

Lol nvm got it, will make it an optional plugin for people to use. :+1:

GenerelSchwerz commented 1 year ago

Finished, added the auto respawn in this update. It will be supported for all later versions.