Skip to content

bot is unable to connect to any server #3612

@boxyfour

Description

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

Versions

  • mineflayer: most recent
  • server: localhost / lan, any regular server aswell
  • node: 23.9.0

Detailed description of a problem

tried using the boiler plate provided by the wiki, but whenever my project starts i'm hit with this:

TypeError: Cannot read properties of null (reading 'version')

What did you try yet?

tried using other people's boilerplate, my own, etc. changed versions, ports

Did you try any method from the API?
Did you try any example? Any error from those?

the first example on the github

Your current code

const mineflayer = require("mineflayer");

const bot = mineflayer.createBot({
  host: "localhost", // minecraft server ip
  username: "Bot", // username to join as if auth is `offline`, else a unique identifier for this account. Switch if you want to change accounts
  auth: "offline", // for offline mode servers, you can set this to 'offline'
  port: 34835, // set if you need a port that isn't 25565
  // version: false,           // only set if you need a specific version or snapshot (ie: "1.8.9" or "1.16.5"), otherwise it's set automatically
  // password: '12345678'      // set if you want to use password-based auth (may be unreliable). If specified, the `username` must be an email
});

bot.on("chat", (username, message) => {
  if (username === bot.username) return;
  bot.chat(message);
});

// Log errors and kick reasons:
bot.on("kicked", console.log);
bot.on("error", console.log);

Expected behavior

A clear and concise description of what you expected to happen.

bot to join the server, nothing else

Additional context

Add any other context about the problem here.

using nodejs

log.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stage1just created by someone new to the project, we don't know yet if it deserves an implementation / a fpossible bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions