Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot disconnecting from server without any logs (kick or error) #3288

Open
1 task
numixdev opened this issue Jan 21, 2024 · 5 comments
Open
1 task

Bot disconnecting from server without any logs (kick or error) #3288

numixdev opened this issue Jan 21, 2024 · 5 comments
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f waiting info from op

Comments

@numixdev
Copy link

  • The FAQ doesn't contain a resolution to my issue

Versions

  • mineflayer: 4.18.0
  • server: folia
  • node: 21.5.0

Detailed description of a problem

A clear and concise description of what the problem is, with as much context as possible.
Bot only working correctly on LAN servers. In public servers it logs with the nickname "%luckperms_highest_inherited_group_by_weight%(botname)"
What are you building? What problem are you trying to solve?
The bot can walk (so it passes the spawn hub of the server) and was supposed to message the chat after 15 seconds but nothing happends (only worked in LAN server)

What did you try yet?

Nothing I tried fixed or enhanced it.

Did you try any method from the API?
No
Did you try any example? Any error from those?
I've got no error in the console, but with the minecraft protocol I get this when the bot disconnects:

Error: client timed out after 30000 milliseconds
    at Timeout._onTimeout (/home/numix/Projects/MineBot/node_modules/minecraft-protocol/src/client/keepalive.js:18:28)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)
Error: client timed out after 30000 milliseconds
    at Timeout._onTimeout (/home/numix/Projects/MineBot/node_modules/minecraft-protocol/src/client/keepalive.js:18:28)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)

Your current code

process.env.DEBUG = 'minecraft-protocol'
const mineflayer = require('mineflayer')

const bot = mineflayer.createBot({
  host: 'localhost',
  port: '46141',
  username: 'LocalBot'
})

bot.once('spawn', () => {
  bot.setControlState('forward', true); // start walking

  setTimeout(() => {
    bot.setControlState('forward', false); // stop walking after 10 seconds
  }, 10000);
});

bot.once('spawn', () => {
  setTimeout(() => {
    bot.chat('hi'); // say hi after 15 seconds
  }, 15000);
});

bot.on('kicked', console.log)
bot.on('error', console.log)

Expected behavior

A clear and concise description of what you expected to happen.
Bot walks for 10 seconds and chat "hi" after 15

@numixdev numixdev added possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f labels Jan 21, 2024
@extremeheat
Copy link
Member

Can you provide the debug output from the console?

@numixdev
Copy link
Author

Can you provide the debug output from the console?

I only get this error

Error: client timed out after 30000 milliseconds
    at Timeout._onTimeout (/home/numix/Projects/MineBot/node_modules/minecraft-protocol/src/client/keepalive.js:18:28)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)
Error: client timed out after 30000 milliseconds
    at Timeout._onTimeout (/home/numix/Projects/MineBot/node_modules/minecraft-protocol/src/client/keepalive.js:18:28)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)
    ```

@wgaylord
Copy link
Contributor

You need to enable debugging using https://github.com/PrismarineJS/mineflayer?tab=readme-ov-file#debug to get the debug info that extremeheat is looking for.

@wgaylord
Copy link
Contributor

I suspect this is due to #3292 but it could be its own separate issue.

@numixdev
Copy link
Author

Ok, thanks. Will try and report here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
possible bug Stage1 just created by someone new to the project, we don't know yet if it deserves an implementation / a f waiting info from op
Projects
None yet
Development

No branches or pull requests

3 participants