Closed Myzumi closed 10 months ago
This is because you are not waiting for the correct event. mineflayer requires you to wait for events like spawn
before those functions become available.
This is because you are not waiting for the correct event. mineflayer requires you to wait for events like
spawn
before those functions become available.
Worked before without waiting for that event, so it was defently not mentioned in the changelog
It should not have been working if it did, as createBot() is not a synchronous call, it works asynchronously. As in the examples, all the mineflayer bot API methods (like this one) have to be called after the appropriate event, like connection to server, etc. Should be made clear in the API if not already. Feel free to do a PR to add that note to the api.md
Versions
Detailed description of a problem
A clear and concise description of what the problem is, with as much context as possible. What are you building? What problem are you trying to solve?
bot.addChatPattern does not existis anymore when upgrading to mineflayer@4.9 from 4.8.1 It has been tested with the latest version and with 4.10, 4.9, 4.8.1/4.8
What did you try yet?
Downgrading to find exact version that changes this. This problem also persist in all versions above 4.9
Your current code
most of the unrelated code has been removed and only relevant code is shown.
Expected behavior
A clear and concise description of what you expected to happen. That bot.addChatPattern exists on the bot property in the version 4.9 and above as changelog does not state that it had been removed.
Additional context
Add any other context about the problem here.