From e9a17374d1e441943cd973a5e23c140ba36a93c1 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 21 May 2022 20:29:25 +0100 Subject: [PATCH] Rewrite documentation of CommandEvent no wonder people get the idea to use this shit for banning commands ... --- src/event/server/CommandEvent.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/event/server/CommandEvent.php b/src/event/server/CommandEvent.php index 818a465cb..9a982d230 100644 --- a/src/event/server/CommandEvent.php +++ b/src/event/server/CommandEvent.php @@ -28,12 +28,18 @@ use pocketmine\event\Cancellable; use pocketmine\event\CancellableTrait; /** - * Called when any CommandSender runs a command, early in the process + * Called when any CommandSender runs a command, before it is parsed. * - * You don't want to use this except for a few cases like logging commands, - * blocking commands on certain places, or applying modifiers. + * This can be used for logging commands, or preprocessing the command string to add custom features (e.g. selectors). * - * The message DOES NOT contain a slash at the start + * WARNING: DO NOT use this to block commands. Many commands have aliases. + * For example, /version can also be invoked using /ver or /about. + * To prevent command senders from using certain commands, deny them permission to use the commands you don't want them + * to have access to. + * + * @see Permissible::addAttachment() + * + * The message DOES NOT begin with a slash. */ class CommandEvent extends ServerEvent implements Cancellable{ use CancellableTrait;