Minecraft command only control certain game mode?

Ma
3

How can I bring everyone who is in a certain radius, and in survival is in adventure mode. I tried it with / gamemode 2 @e [type = player, r10] but this command only spams everything up because it brings you into gamemode 2 continuously, regardless of whether it's survival or adventure

ba

Not even googling https://minecraft-de.gamepedia.com/...l/gamemode for 1 minute

ba

Against spamming you can / gamerule command output false
I don't know if I'm wrong, but this is how you can prevent spam.

gl

1.13+: / gamemode @a [distance = .10, gamemode = survival]

1.12-: / gamemode @a [r = 10, m = survival]

Works 100%

@e [type = player] is the same as @a