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

__on_player_command cannot be canceled #1739

Open
shenjackyuanjie opened this issue Jun 7, 2023 · 1 comment · May be fixed by #1740
Open

__on_player_command cannot be canceled #1739

shenjackyuanjie opened this issue Jun 7, 2023 · 1 comment · May be fixed by #1740

Comments

@shenjackyuanjie
Copy link

the problem

__on_player_command cannot be canceled

how dose the issue cause

At bf00051#diff-c0b8d21ffce3a7e67a88bad905379bdccb7d9b64e9be98f4739607b1573b75a0

The __on_player_message event was added
At the moment, the event was uncancelable

At 24b9c38#diff-c0b8d21ffce3a7e67a88bad905379bdccb7d9b64e9be98f4739607b1573b75a0R302

Many event have ability to canceled

At 43bb844#diff-c0b8d21ffce3a7e67a88bad905379bdccb7d9b64e9be98f4739607b1573b75a0R313

The __on_player_command event was also added
to make on_player_message event not triggered by player command
but at the same time 43bb844#diff-8604ab23b322f862f9399fb1e6a685ea4900460b0202453c399f8221c09ba72c
the docs was modified, the line 321 was been moved to line 324, with no changes
witch tells people "the command event is cancelable, the message event is not"

but the truth is the command event mixin can't cancel 43bb844#diff-c0b8d21ffce3a7e67a88bad905379bdccb7d9b64e9be98f4739607b1573b75a0R313

So now the __on_player_command event can't cancel
and the __on_player_message can

how to fix it

add a ci.cancel at

PLAYER_COMMAND.onPlayerMessage(player, serverboundChatCommandPacket.command());

change docs for these two event

@shenjackyuanjie
Copy link
Author

I'm making a PR for it(

@shenjackyuanjie shenjackyuanjie linked a pull request Jun 7, 2023 that will close this issue
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 a pull request may close this issue.

1 participant