Skip to content

fix: ignore invalid commands before applying cooldown (closes #6573) - #6631

Open
RomainCabaret wants to merge 1 commit into
EssentialsX:2.xfrom
RomainCabaret:fix/feed-cooldown-case
Open

RomainCabaret wants to merge 1 commit into
EssentialsX:2.xfrom
RomainCabaret:fix/feed-cooldown-case

Conversation

@RomainCabaret

Copy link
Copy Markdown

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 in EssentialsPlayerListener.

Under Brigadier (1.13+), command matching is case-sensitive, meaning capitalized aliases such as /FEED or /EFEED are 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

  • Most recent Paper version (26.2)
  • CraftBukkit/Spigot/Paper 1.12.2
  • CraftBukkit 1.8.8

Demonstration:

Capture d’écran du 2026-09-30 20-12-54 Capture d’écran du 2026-09-30 20-13-50

@mdcfe

mdcfe commented Sep 30, 2026

Copy link
Copy Markdown
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.

@RomainCabaret

Copy link
Copy Markdown
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. /FEED).

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?

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.

feed command delay activates when used in all caps, but all caps does not send the command.

2 participants