--- a/net/minecraft/server/commands/SetSpawnCommand.java
+++ b/net/minecraft/server/commands/SetSpawnCommand.java
@@ -32,9 +32,21 @@
     private static int setSpawn(CommandSourceStack source, Collection<ServerPlayer> targets, BlockPos pos, float angle) {
         ResourceKey<Level> resourceKey = source.getLevel().dimension();
 
+        final Collection<ServerPlayer> actualTargets = new java.util.ArrayList<>(); // Paper
         for(ServerPlayer serverPlayer : targets) {
-            serverPlayer.setRespawnPosition(resourceKey, pos, angle, true, false);
+            // Paper start - PlayerSetSpawnEvent
+            if (serverPlayer.setRespawnPosition(resourceKey, pos, angle, true, false, com.destroystokyo.paper.event.player.PlayerSetSpawnEvent.Cause.COMMAND)) {
+                actualTargets.add(serverPlayer);
+            }
+            // Paper end
         }
+        // Paper start
+        if (actualTargets.isEmpty()) {
+            return 0;
+        } else {
+            targets = actualTargets;
+        }
+        // Paper end
 
         String string = resourceKey.location().toString();
         if (targets.size() == 1) {
