Skip to content

Problems with bot.experience #3598

Open
@IKorzI

Description

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

Versions

  • mineflayer: 4.26.0
  • server: vanilla 1.20.1
  • node: 22.11.0

Detailed description of a problem

The bot's experience is written like this:

bot.experience = {
  level: ... ,
  points: ... ,
  progress: ...
}

In Minecraft versions 1.19.2 and below, the points indicator only increases.
In Minecraft versions 1.19.3-1.20.1, the level indicator has the value points and only increases, and the points indicator has the value level.
In Minecraft versions 1.20.2 and above, the points indicator only increases.

What did you try yet?

I tested it on the following versions:
1.21.4, 1.21,
1.20.6, 1.20.5, 1.20.4, 1.20.2, 1.20.1, 1.20,
1.19.4, 1.19.3, 1.19.2, 1.19.
1.16.5,
1.15.2,
1.13.2, 1.13.1, 1.13,
1.12.2,
1.8.9

Your current code

Minimum code to get experience

const mineflayer = require('mineflayer');

const bot = mineflayer.createBot({
  host: "192.168.31.69",
  port: "26000",
  version: "1.20.1",
  username: "_Korz_work2"
})

bot.on('experience', () => {
  console.log(
    `bot.experience.level: ${bot.experience.level}\n` +
    `bot.experience.points: ${bot.experience.points}\n` +
    `bot.experience.progress: ${bot.experience.progress}`
  )
});

Expected behavior

the points indicator will decrease
the level and points indicators will not swap

Additional context

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