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

Handle unknown scoreboard objectives #3191

Merged
merged 7 commits into from
Sep 10, 2023
Merged

Conversation

frej4189
Copy link
Contributor

@frej4189 frej4189 commented Sep 9, 2023

Currently mineflayer will throw if given a scoreboard objective packet with the update action if the objective does not exist.

This "fixes" that by simply emitting an error event instead, allowing the user to do their own error handling.

Vanilla client will also throw when this happens, but will not disconnect the client, so I think simply emitting the error event is the right thing to do, so the user can handle it themselves and decide whether or not to disconnect. Cross-checked only with Vanilla 1.8 client, might have different behaviour in higher versions, but regardless I don't think we can handle it any different than this.

lib/plugins/scoreboard.js Outdated Show resolved Hide resolved
@rom1504 rom1504 merged commit 2e02cee into PrismarineJS:master Sep 10, 2023
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

Successfully merging this pull request may close these issues.

3 participants