Skip to content
MC Command Generator

/spectate Command Generator

Beta

Pick the entity to watch and the player. The generator writes /spectate, adds /gamemode spectator if you want, and stops spectating for other players too.

Describe it — AI writes the command

Type what you want in plain words. The AI fills the form below, so you can see it and change anything. It follows the edition and version you picked.

Checking the AI…

Paste a command— edit it here or move it to another version

Leave the player empty for whoever runs the command.

Spectating: Ender Dragon
Press Sneak to stop
The player sees what the ender dragon sees, and follows it until they press Sneak or /spectate runs again.

Your command · Java 26.3

42 characters
/spectate @e[type=ender_dragon,limit=1] @p
  • The player must already be in spectator mode, or /spectate fails.

Raw editor

How it works

/spectate is the command version of clicking a mob in spectator mode: the player's camera locks onto the entity. Map makers use it for cutscenes and cameras (an armor stand or marker moved with /tp makes a smooth camera path).

Java 1.15 and later

gamemode spectator @p
spectate @e[type=ender_dragon,limit=1] @p
spectate
execute as @p run spectate
  • The player must be in spectator mode — tick "switch to spectator mode first" to add the /gamemode line.
  • The target must be one entity (add limit=1) and can't be the player themselves.
  • spectate on its own stops spectating for whoever runs it; for another player the generator uses execute as.

Bedrock

Bedrock has no /spectate. For cutscenes use the /camera generator.

FAQ

Why does /spectate say the player isn't in spectator mode?

It only works for players in spectator mode. Run gamemode spectator first, or tick the option to add it.

How do I make a cutscene camera?

Summon an armor stand (Invisible, Marker) or a marker entity, spectate it, then move it with /tp each tick from a function or repeating command block.

How do I stop spectating?

Run /spectate with no arguments, press Sneak, or for another player: execute as <player> run spectate.

Is there /spectate on Bedrock?

No. Bedrock's /camera command moves the player's camera instead.