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

Got kick by server in 1.21.3 #3522

Closed
2 of 3 tasks
wubushanyan opened this issue Dec 10, 2024 · 3 comments
Closed
2 of 3 tasks

Got kick by server in 1.21.3 #3522

wubushanyan opened this issue Dec 10, 2024 · 3 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

Comments

@wubushanyan
Copy link

wubushanyan commented Dec 10, 2024

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

Versions

  • mineflayer: 4.23.0
  • server: vanilla/spigot/paper 1.21.3
  • node: v20.10.0

Detailed description of a problem

I wana make a afk bot in server to dig some thing, so the script is simple.
I success make the bot login to the server's lobby(And use other player see the bot stand in the lobby to confirm my script is good)

Usually player should use command /main to go the slimefun server(Idk is call that server right, in the lobby there have 3 server slimefun | carpetsky | original)

But then I got kick. Console show a string An internal error occurred in your connection

What did you try yet?

Try to open DEBUG in console, it show the biome had load, then got kick.

Your current code

const mineflayer = require('mineflayer');
const readline = require('readline'); 


const config = {
    username: 'X', 
    host: 'X', 
    port: 25565,
};


async function createBot() {
    try {
        const bot = mineflayer.createBot({
            host: config.host,
            port: config.port,
            username: config.username,
            auth: 'microsoft',
        });

        bot.on('resourcePack', (url, hash) => {
            console.log('Resource pack URL:', url, 'Hash:', hash);
            bot.acceptResourcePack();
        });

        bot.on('kicked', (reason, loggedIn) => {
            console.log('Kicked from the server:', reason, 'Logged in:', loggedIn);
        });

        bot.on('error', (err) => {
            console.error('Error occurred:', err);
        });

        bot.on('end', () => {
            console.log('Bot disconnected. The connection might have been closed by the server.');
        });

        bot.on('login', () => {
            console.log('Bot successfully logged in.');
        });

        bot.once('spawn', () => {
            console.log('Bot spawned in the world.');
        });

        bot.on('death', () => {
            console.log('Bot died.');
        });

        bot.on('message', (message) => {
            console.log('Chat message:', message.toAnsi());
        });

        const rl = readline.createInterface({
            input: process.stdin,
            output: process.stdout,
        });

        rl.on('line', (input) => {
            if (input.startsWith('/')) {
                bot.chat(input);
                console.log(`Executed command: ${input}`);
            } else {
                bot.chat(input);
                console.log(`Sent message: ${input}`);
            }
        });

        return bot;
    } catch (error) {
        console.error('Bot create fail: ', error);
    }
}

createBot();

Expected behavior

  • Login to the lobby
  • Turn in to Slimefun server

Additional context

The end of the DEBUG message
image

@wubushanyan wubushanyan 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 Dec 10, 2024
@wubushanyan
Copy link
Author

wubushanyan commented Dec 10, 2024

I looked through the commits and found that the support merge for 1.21.3 failed.
#3489
If this issue I opened is related to this issue, please remind me to close it or close it directly.

@extremeheat
Copy link
Member

Only up to 1.21.2 is supported

@wubushanyan
Copy link
Author

Only up to 1.21.2 is supported
OK, closed

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
Projects
None yet
Development

No branches or pull requests

2 participants