From f1ed000eecc7e486ae2adb64dc135509bdf0fc25 Mon Sep 17 00:00:00 2001 From: Romain Date: Wed, 30 Sep 2026 18:53:51 +0200 Subject: [PATCH] fix: ignore invalid commands before applying cooldown (closes #6573) --- .../com/earth2me/essentials/EssentialsPlayerListener.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java b/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java index 60d3b4c25f..b48c0fa539 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java +++ b/Essentials/src/main/java/com/earth2me/essentials/EssentialsPlayerListener.java @@ -867,6 +867,13 @@ public void handlePlayerCommandPreprocess(final PlayerCommandPreprocessEvent eve } if (!cooldownFound) { + final String exactLabel = event.getMessage().split(" ")[0].replace("/", ""); + + // Check if the command is actually known to the server before applying a cooldown. + if (!ess.provider(KnownCommandsProvider.class).getKnownCommands().containsKey(exactLabel)) { + return; + } + final Entry cooldownEntry = ess.getSettings().getCommandCooldownEntry(fullCommand); if (cooldownEntry != null) {