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.
Commandblock 2
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
and/or
/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?
***FINAL NOTE***
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?
This is what’s i use. Think of it like a shield. You have to pass through the perimeter/edge for it to take effect. So teleporting and spawning in will not work.
Command block A : Set to adventure
Settings: Repeat, unconditional, always on
gamemode a @a[name=!yourName, rm=35, r=36]
Command block B: Set to survival
Settings: Repeat, unconditional, always on
gamemode s @a[name=!yourName, rm=36, r=37]
I recommend turning command block output off.
Name=!yourName is optional. This prevents the blocks from changing your game mode.
To get around new players spawning in on survival:
1. Set world spawn to somewhere isolated. Get cords
2. Commandblockchain:
A. If player in world spawn, change spawn point
B. Set game mode to adventure
C. Teleport player to your real spawn area.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
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.
Commandblock 2
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
and/or
/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?
***FINAL NOTE***
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?
I decided to post my answer from the other thread anyways if you want it.
Put this all within a ticking area and this should do it.
TO ACTIVATE
/testfor @e[type=player,x=xmin,y=ymin,z=zmin,dx=xarea,dy=yarea,dz=zarea] (RCB Always Active)---
--->comparator------>redstone_wire------>repeater---
--->/gamemode adventure @e[type=player,x=xmin,y=ymin,z=zmin,dx=xarea,dy=yarea,dz=zarea](RCB Needs Redstone)
TO DEACTIVATE
redstone_wire------>redstone_torch(off the side)------>repeater---
--->/gamemode survival @e[type=player,x=xmin,y=ymin,z=zmin,dx=xarea,dy=yarea,dz=zarea](ICB Always Active)
This is what’s i use. Think of it like a shield. You have to pass through the perimeter/edge for it to take effect. So teleporting and spawning in will not work.
Command block A : Set to adventure
Settings: Repeat, unconditional, always on
gamemode a @a[name=!yourName, rm=35, r=36]
Command block B: Set to survival
Settings: Repeat, unconditional, always on
gamemode s @a[name=!yourName, rm=36, r=37]
I recommend turning command block output off.
Name=!yourName is optional. This prevents the blocks from changing your game mode.
To get around new players spawning in on survival:
1. Set world spawn to somewhere isolated. Get cords
2. Commandblockchain:
A. If player in world spawn, change spawn point
B. Set game mode to adventure
C. Teleport player to your real spawn area.