A friend of mine has a public realm so we decided to have a spawn area with rules and information. Since bedrock edition has no spawn protection like java has by default we decided to use some command blocks. The idea was that if a player was in 75 blocks of spawn center they would automatically get put in adventure mode so they cannot break / place blocks. When they get into the area of 76 - 100 blocks out they get placed into survival mode. We used a youtube tutorial that showed how this is done.
Command block 1
gamemode a @a[r=75,m=s]
Set to = repeat and needs redstone with a lever flipped on. This was done so the command blocks can be switched off since you cannot change anything in them when they are set to always active w/o having to destroy the command block it's self.
gamemode s @a[r=100,m=a]
Set to = repeat and needs redstone with another lever flipped on. The origional tut required the command block to be set to impulse and chain. the reason for this change is because every tutorial i find about this subject is done using the java edition of minecraft and redstone / command blocks function differently in bedrock edition. So the 2nd command block would not function at all and we were needing to set player gamemode manually every time a new player enters the realm.
The problem that we still have is that 1. Players still may not be placed into survival. 2. Everyone at spawn gets spammed with your game mode has been changed messages to the point that chat at spawn is impossible.
Is there a way to fix the issues for the spam and get the game mode change to work 100%?
To take care of the spam you should be able to run :
/gamerule sendcommandfeedback false
/gamerule commandblockoutput false
Few questions of my own:
have you used /setworldspawn?
For your second command. Couldn't it be a chain command block set to always active on your first RCB?
If you don't like this solution I literally just did one for another server that wants players to be in adventure while they are at the central hub but then want them to be in survival when they leave. Is this something you would want if the above doesn't help?