fix: ignore invalid commands before applying cooldown (closes #6573) - #6631
Open
RomainCabaret wants to merge 1 commit into
Open
RomainCabaret wants to merge 1 commit into
RomainCabaret wants to merge 1 commit into
Conversation
Member
|
This approach would fundamentally break command alias plugins that inject themselves at the pre-process event level. While that isn't something we'd generally support (aliases should really be registered to the command map and Brigadier in 2026), I'm hesitant to potentially break existing alias setups here. |
Author
|
Sorry about that, I hadn't considered custom alias plugins hooking in at the preprocess level. The issue with #6573 is that Essentials applies cooldowns case-insensitively, even when Brigadier later rejects the command due to strict case sensitivity (e.g. How would you prefer to handle this without breaking alias plugins? Should we only apply this check to commands registered by EssentialsX itself, or handle it differently? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Information
This PR fixes #6573 .
Details
Proposed fix:
Check whether the exact raw command label typed by the player exists in the server's registered commands (via
KnownCommandsProvider) before applying a cooldown inEssentialsPlayerListener.Under Brigadier (1.13+), command matching is case-sensitive, meaning capitalized aliases such as
/FEEDor/EFEEDare rejected by the server as unknown commands. Previously, EssentialsX converted the command to lowercase early and still applied the configured cooldown despite the command failing to execute. With this check, unknown or incorrectly capitalized commands are ignored by the cooldown handler and will not unfairly consume the player's cooldown.Environments tested:
OS: Fedora Linux
Java version: OpenJDK 21
Demonstration: