If you're looking at naturally spawned hostile mobs in creative mode, when you switch to spectator mode, they immediately despawn.
Linked issues
is duplicated by 51
46 more links
If you're looking at naturally spawned hostile mobs in creative mode, when you switch to spectator mode, they immediately despawn.
If there is no other player within 128 blocks, the mobs will despawn like normal. Their behavior, AI, spawning, despawning, and otherwise ignores any spectating players as those players are not supposed to have any impact or interaction with the gameplay.