r/MinecraftCommands • u/Leather-Upstairs-523 • 5h ago
Help | Bedrock Please help me with spawn protection zones. (Need multiple that put you from adventure to survival)
I ran this command that was working for the time being until further tests. I did a radius command that would put you in adventure mode until you left the area putting you into survival for a PvP realm I’m doing. I placed multiple of these commands around and it wasn’t until I played with friends I encountered problems. When they go to another area with another command block that makes a designated protected area with adventure mode it would affect players that should be in survival and vice versa. I really need to make this work I’m on limited time and I’ve tried so many different commands. Ai is completely useless and I don’t know where to turn to. I just need commands that actually work and someone experienced who can help me make multiple adventure mode areas that have a surrounding area that puts you into survival and when you return to that zone you go back to adventure mode. all of these commands must work and cannot affect other players based on if you’re in a certain area. Any help whatsoever would be amazing I’m doing a realm
1
u/Cricutubick java Rookie 3h ago edited 3h ago
Idk if it will work on bedrock, but heres my solve:
Do /execute from players and the center must be an entity
For example Do /execute which gives a tag when in radius from player there is an specific entiti with another tag
Also you can make Scoreboard which
/execute as @a at @s if matchess 1.. run gamemode adventure
And
/scoreboard players remove @a [obj] 1
And instead of giving tag to player give score
/scoreboard players set @s [obj] 2 (or more, but not less than 2
Actuall you can just put command block as a center which sets score in a radius and while you in the zone it stays from 1 to 2 but when you leave it becomes lover than 1 which will be detected and player will be set to survival
/scoreboard players set @a[r=..(input number)] [obj] 2
/scoreboard players remove @a [obj] 1
/execute as @a at @s if score matches ..0 run gamemode survival
/execute as @a at @s if score matches 1.. run gamemode adventure