--- a/net/minecraft/server/commands/GameModeCommand.java
+++ b/net/minecraft/server/commands/GameModeCommand.java
@@ -48,9 +48,14 @@
         int i = 0;
 
         for(ServerPlayer serverPlayer : targets) {
-            if (serverPlayer.setGameMode(gameMode)) {
+            // Paper start - extend PlayerGameModeChangeEvent
+            org.bukkit.event.player.PlayerGameModeChangeEvent event = serverPlayer.setGameMode(gameMode, org.bukkit.event.player.PlayerGameModeChangeEvent.Cause.COMMAND, net.kyori.adventure.text.Component.empty());
+            if (event != null && !event.isCancelled()) {
                 logGamemodeChange(context.getSource(), serverPlayer, gameMode);
                 ++i;
+            } else if (event != null && event.cancelMessage() != null) {
+                context.getSource().sendSuccess(() -> io.papermc.paper.adventure.PaperAdventure.asVanilla(event.cancelMessage()), true);
+                // Paper end
             }
         }
 
