[SPIGOT-1111] ServerCommandEvent does not cancel despite implementing Cancellable Created: 04/Aug/15  Updated: 11/Dec/17  Resolved: 08/Aug/15

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: t7seven7t Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: Craftbukkit


 Description   

Commit 8f9ff9f6fd4 to Spigot/CraftBukkit was supposed to resolve this issue but neglected to cancel the event in the method for native console users. That commit only cancels for remote connections.

The code executing the command is never halted even if the event has been cancelled here:
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/nms-patches/DedicatedServer.patch#172



 Comments   
Comment by RandomPanda30 [ 05/Aug/15 ]

And setting the command to that will stop the unknown command message from appearing?

Comment by Shevchik [ 05/Aug/15 ]

Indeed, i forgot that i have a patched class that changes command to "" on setCancelled.
Well, you can set the command to "" to workaround this currently

Comment by t7seven7t [ 05/Aug/15 ]

No, that is the code that executes commands sent using a remote console. Look at the line shown by the link in the description please.

Comment by Shevchik [ 05/Aug/15 ]

It is not cancelled, but instead the command is set to "" due to decompilation issues with some sort of command senders

Comment by RandomPanda30 [ 04/Aug/15 ]

Managed to find this issue when trying to cancel the event and instead, it keeps returning the "Unknown command. Type "/help" for help." message

Generated at Tue Apr 08 01:20:43 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.