PocketMine-MP
                                
                                
                                
                                    PocketMine-MP copied to clipboard
                            
                            
                            
                        Remove PlayerCommandPreProcessEvent
Description
PlayerCommandPreProcessEvent no longer has any practical value and is confusing. It should be removed.
Justification
From Discord #internals-dev from 2019 chat logs (https://discord.com/channels/373199722573201408/546255162222706696/595894033256153128)
- it confuses people
 - it doesn't really serve any purpose since the introduction of CommandEvent
 - if you wanted to convert a chat message into a command, you can do so without the use of the preprocess event - it would make more sense to cancel the chat message and send the command via Server->dispatchCommand()
 
Can't think of any practical usage anymore except stupid priority overriding.
Make it send warnings in the console while devtools is installed, I think removing it would just be an annoyance for most people.
As I wrote in the original post, there is no practical use case for it in modern times. Therefore, the only people who will be annoyed are the people who are still using it for some purpose that they don't need it for.
I'm referring to people using public plugins that use this event. Backwards compatibility is important.
The issue is clearly labelled "BC break" for a reason ...
Impact analysis via Poggit suggests that the impact of this is zero for public plugins (no usages from PM4 plugins, and only 1 PM3 plugin used it).
I'm referring to people using public plugins that use this event. Backwards compatibility is important.
People currently using PlayerCommandPreprocessEvent are mostly misusing it. That's exactly why we are removing it.