diff --git a/paper-api/src/main/java/org/bukkit/command/CommandMap.java b/paper-api/src/main/java/org/bukkit/command/CommandMap.java index 079910c860..2b92480a17 100644 --- a/paper-api/src/main/java/org/bukkit/command/CommandMap.java +++ b/paper-api/src/main/java/org/bukkit/command/CommandMap.java @@ -44,7 +44,7 @@ public interface CommandMap { * Looks for the requested command and executes it if found. * * @param cmdLine command + arguments. Example: "/test abc 123" - * @return targetFound returns false if no target is found. + * @return targetFound returns false if no target is found, true otherwise. * @throws CommandException Thrown when the executor for the given command fails with an unhandled exception */ public boolean dispatch(CommandSender sender, String cmdLine) throws CommandException; diff --git a/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java b/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java index 472716b4e2..3d868f79f6 100644 --- a/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java +++ b/paper-api/src/main/java/org/bukkit/command/SimpleCommandMap.java @@ -124,12 +124,16 @@ public final class SimpleCommandMap implements CommandMap { } try { - return target.execute(sender, sentCommandLabel, Arrays_copyOfRange(args, 1, args.length)); + // Note: we don't return the result of target.execute as thats success / failure, we return handled (true) or not handled (false) + target.execute(sender, sentCommandLabel, Arrays_copyOfRange(args, 1, args.length)); } catch (CommandException ex) { throw ex; } catch (Throwable ex) { throw new CommandException("Unhandled exception executing '" + commandLine + "' in " + target, ex); } + + // return true as command was handled + return true; } public synchronized void clearCommands() {