From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Sweepyoface Date: Sat, 17 Jun 2017 18:48:21 -0400 Subject: [PATCH] Add UnknownCommandEvent diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index c7136bddf38583167f3944e56df6a26f4c56308f..6f1b1191426d864719e1b5cbd42bf5699e6193e3 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -886,7 +886,13 @@ public final class CraftServer implements Server { // Spigot start if (!org.spigotmc.SpigotConfig.unknownCommandMessage.isEmpty()) { - sender.sendMessage(org.spigotmc.SpigotConfig.unknownCommandMessage); + // Paper start + org.bukkit.event.command.UnknownCommandEvent event = new org.bukkit.event.command.UnknownCommandEvent(sender, commandLine, org.spigotmc.SpigotConfig.unknownCommandMessage); + Bukkit.getServer().getPluginManager().callEvent(event); + if (event.message() != null) { + sender.sendMessage(event.message()); + } + // Paper end } // Spigot end