Implement listener for PaperMC's AsyncPlayerSendCommandsEvent
#1
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Milestone
Context
BlackWidow's command blocking module requires a listener to review and manage command suggestions that the server/proxy implementation wants to send to players.
The Bukkit API has
PlayerCommandSendEvent
, which works great, with one major caveat: the server calls it synchronously.On PaperMC server implementations, we can instead listen to
AsyncPlayerSendCommandsEvent.html
, which is (usually - but not guaranteed to.. anyways,) be called asynchronously by the server.Challenges
This event seems to not be well-known and thus isn't utilized often in plugins. With rather limited documentation on the event and (very) poor knowledge with Brigadier, I'm ill-equipped as of posting this issue to tackle this.
To expand on the Brigadier challenge: the Paper event presents a Brigadier command node - a more contemporary API choice, which is great, but requires a new style of parser. Furthermore, instead of rather simple lists of arguments suggestions, we get a root command tree which needs to be managed entirely differently than just simply removing offending strings from a mutable list (Bukkit API / legacy approach).
Goals
PlayerCommandSendListener
when PaperMC is used.AsyncPlayerSendCommandsListener
.AsyncPlayerSendCommandsListener
when PaperMC is used.Other
I plan to work on this. If you have worked with this event before, please feel free to let me know below, I would love some assistance :)
The text was updated successfully, but these errors were encountered: