This enables administrators to flexibly spawn players in game modes other than their current modes, and also allows administrators to spawn non-creative players from the console or rcon.
Usage: /player spawn bot in <gamemode>
Usage: /player spawn bot at ~ ~ ~ face 0 0 in minecraft:overworld in <gamemode>
Permissions required: OP Level 2 and above.
Note on flying: For spectator players, flying is always enabled. For other game modes, whether they are flying depends on the command caller. Therefore, it is possible to spawn a flying survival player when you are currently flying.