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

In 1.17 server mineflayer-pathfinder works after respawn #212

Closed
1 task done
qsef1256 opened this issue Oct 17, 2021 · 1 comment
Closed
1 task done

In 1.17 server mineflayer-pathfinder works after respawn #212

qsef1256 opened this issue Oct 17, 2021 · 1 comment

Comments

@qsef1256
Copy link

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

Versions

  • mineflayer: 3.11.2
  • server: paper 1.17.1
  • node: 14.18.1

Detailed description of a problem

https://github.com/PrismarineJS/mineflayer/blob/92e54f6d533d5b1e9dd0022754947845606eda56/examples/pathfinder/gps.js
https://github.com/PrismarineJS/mineflayer-pathfinder/blob/29f61cffe3906a82f50d9e176f0a1c0f0d3f4d9b/examples/example.js

Both examples will not work until respawn in 1.17.

My code is not working with the same problem.
It might be duplication of PrismarineJS/mineflayer#2177.

What did you try yet?

  • Did you try any method from the API?

tried manually update target like:

bot.on('physicTick', async () => {
  if(!target) { return }
  try {
    await bot.pathfinder.goto(new goals.GoalNear(target.position.x,target.position.y,target.position.z,2) ,(err) => {
      console.log(err)
    })
  } catch (e) {
    console.warn(e)
  }
})

It worked when I used bot.pathfinder.setGoal and bot.pathfinder.goto at the same time, but it gets very slow on arrival and crashes soon:

bot.pathfinder.setGoal(new GoalFollow(player,2), true)
bot.pathfinder.goto(new GoalFollow(player,2))
  • Did you try any example? Any error from those?

I ran the two example codes in description.
The information of event path_update is: I can get there in 0 moves. Computation took 0.04 ms (1 nodes, 1173.71 nodes/tick)

It seems that the path is not set properly.

Your current code

https://pastebin.com/wKqBLvkW

Expected behavior

mineflayer-pathfinder should work fine without respawning.

Additional context

If the bot dies while following the target, the bot will move to the target's last location. I wonder if it's a bug or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant