From 899f2acb8499f0b120eb7f2e1f95a19163a88529 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 20 Apr 2024 11:26:09 +1000 Subject: [PATCH] #993: Deprecate Command's permission message methods as they no longer work Ever since Mojang's introduction of Brigadier in 1.13, the client is not sent any commands to which it does not have permission to execute. If a client executes a command it is not aware of (and consequently does not have permission for), the client will send itself instead of forwarding the failure to the server for its response. By: 2008Choco --- .../src/main/java/org/bukkit/command/Command.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/command/Command.java b/paper-api/src/main/java/org/bukkit/command/Command.java index 0577d80a21..d498b16bb9 100644 --- a/paper-api/src/main/java/org/bukkit/command/Command.java +++ b/paper-api/src/main/java/org/bukkit/command/Command.java @@ -314,7 +314,14 @@ public abstract class Command { * command * * @return Permission check failed message + * @deprecated permission messages have not worked for player-executed + * commands since 1.13 as clients without permission to execute a command + * are unaware of its existence and therefore will not send an unknown + * command execution to the server. This message will only ever be shown to + * consoles or when this command is executed with + * {@link Bukkit#dispatchCommand(CommandSender, String)}. */ + @Deprecated @Nullable public String getPermissionMessage() { return permissionMessage; @@ -378,7 +385,14 @@ public abstract class Command { * @param permissionMessage new permission message, null to indicate * default message, or an empty string to indicate no message * @return this command object, for chaining + * @deprecated permission messages have not worked for player-executed + * commands since 1.13 as clients without permission to execute a command + * are unaware of its existence and therefore will not send an unknown + * command execution to the server. This message will only ever be shown to + * consoles or when this command is executed with + * {@link Bukkit#dispatchCommand(CommandSender, String)}. */ + @Deprecated @NotNull public Command setPermissionMessage(@Nullable String permissionMessage) { this.permissionMessage = permissionMessage;