Call ServerCommandEvent on Bukkit#dispatchCommand#9661
Conversation
|
Thanks for your contribution, however why are we superseding this 2 day old PR? |
|
The author of the first PR created it really fast and a comment was added one hour after its push. |
|
An important note: this is a potentially breaking API change. Some plugins may rely on the behavior that ServerCommandEvent is not called by using |
|
Mhm, yes, I was considering pinging @4drian3d whose plugin SignedVelocity relies on command and chat events. However, this PR is only for the ServerCommandEvent, so that plugin will not be affected. Other plugins might. Really, dispatching a console command is something of a universal interface between plugins, and lots of plugins implement features that use |
|
For years theres been a general contract that API calls, outside of niche cases, will not fire events; I fail to see the argument for breaking this assertion here |
|
I created this PR because in my opinion, an event should be fired because, as the javadocs says : "This event is called when a command is run by a non-player.". As dispatching a command with the console is running it by "a non-player", i though that it would be legitimate. I understand that maybe some plugins may run differently because of this patch but for me, only some plugins that log these entries. I can't see a situation where it would break. What about creating a new event (DispatchCommandEvent, APIDispatchCommandEvent ?) or creating a config option ? |
|
Ended up closing the original issue as it right now isn't feasible to implement this way. I hope we see more contributions from you in the future :) |

Patches #9644
Supersedes #9646
I used the same plugin i used for my issue ( #9644 ) and now it works fine.
This is my first PR so i don't really know if i made these things right :)