so I’m on BE. Iv done a lot of this but this one part is the only thing giving me problems.
I add any player that enters an area to a scoreboard and change them to adventure. But the bit I’m confused with is when they leave I know I could make it work if I used RM=. But this isn’t a square it’s a rectangle
what Iv got so far is.
adv is the score name
0=they are outside area
1=they have entered area
2=Inside area and game mode changed
3=outside area
then it changes gamemode and sets to 0 again
/scoreboard player set @a [x=,y=,z=,dx=,dy=,dz=,scores ={ adv =0 }]adv 1
/gamemode a @a[scores ={adv=1}]
/scoreboard player set @a[scores={adv=1}] adv 2
plus us a few more but they repeat these steps
but I carnt think of a way to check outside this box for players with adv 2 without the RM= ?
sorry in advance if any of this looks weird I’m on a phone
I've done this exact thing. Set up a simple hopper clock, just 2 hoppers facing into each other. Take a signal from each. From one comparator (point to a solid block with impulse next to it if you want the chains next to each other) put the following:
Note that the whole thing could be done in a single chain, but using the hopper clock allows you to easily add adventure areas later by simply adding to the first chain. If you do it all in one then the gamemode setting commands have to be moved every time you add a new location, because they have to execute after all the scoreboard changes.
This method will work with multiple players, is not broken by lag, allows for a new area added with a single additional command block, and can even manage complicated decisions like nested zones (survival zone inside adventure zone inside survival zone).
I've done this exact thing. Set up a simple hopper clock, just 2 hoppers facing into each other. Take a signal from each. From one comparator (point to a solid block with impulse next to it if you want the chains next to each other) put the following:
Note that the whole thing could be done in a single chain, but using the hopper clock allows you to easily add adventure areas later by simply adding to the first chain. If you do it all in one then the gamemode setting commands have to be moved every time you add a new location, because they have to execute after all the scoreboard changes.
This method will work with multiple players, is not broken by lag, allows for a new area added with a single additional command block, and can even manage complicated decisions like nested zones (survival zone inside adventure zone inside survival zone).
I love this idea but I have one question. Understand I'm still pretty new to using command blocks and setting regions so forgive me if this is a dumb question. I haven't tried it yet either but here goes. Now, if I understand this right inside the defined zone all players are being changed to adventure mode and 1 block outside of that defined zone all players will be receiving the survival mode command. But what if you have certain players also in that outside area who are working in creative mode or you yourself wish to change your gamemode to creative? Will the hopper clock not continually over ride this and set everyone into survival mode? Is there a work around for this scenario that does not involve giving everyone creative mode or placing everyone in survival mode?
Rollback Post to RevisionRollBack
Ask me about our Bedrock Minecraft Realm - New Caledonia and our Java MCMMORPG Server Hy-Brasil.
It only changes players from survival to adventure or back, it won't affect players in creative. You can also create a separate scoreboard objective to define players that it shouldn't affect at all, and include that in the second set of commands.
For example
gamemode s @a[scores={adv=0, fixedmode=0}]
Now you can set a repeating block that does
scoreboard players add @a fixedmode 0
Anyone logging in will have the objective added of it isn't already, everyone else will have 0 added to their existing score. Anyone you want controlling their own mode or otherwise not being changed by the automatic system you give a score of fixedmode 1.
so I’m on BE. Iv done a lot of this but this one part is the only thing giving me problems.
I add any player that enters an area to a scoreboard and change them to adventure. But the bit I’m confused with is when they leave I know I could make it work if I used RM=. But this isn’t a square it’s a rectangle
what Iv got so far is.
adv is the score name
0=they are outside area
1=they have entered area
2=Inside area and game mode changed
3=outside area
then it changes gamemode and sets to 0 again
/scoreboard player set @a [x=,y=,z=,dx=,dy=,dz=,scores ={ adv =0 }]adv 1
/gamemode a @a[scores ={adv=1}]
/scoreboard player set @a[scores={adv=1}] adv 2
plus us a few more but they repeat these steps
but I carnt think of a way to check outside this box for players with adv 2 without the RM= ?
sorry in advance if any of this looks weird I’m on a phone
You can set up a slightly bigger detection box command block right next to the one you're using to for setting the player to adventure.
Set a command block (let's call it CB2) that detects if a player is in the zone (same as the one you had before, but with +1 to every digit):
/execute @a[dx=xn+1, dy=yn+1, dz=zn+1] ~~~ scoreboard player set ...
where xn, yn, zn = how big you made the original detection box.
You turn it to be repeating, unconditional, and needs redstone.
Then you add a comparator to your original command block (which detects whether a player entered the zone).
When the comparator is on: CB2 becomes unpowered. When the comparator is off: CB2 is powered.
This means that upon leaving the box, CB2 detects the player and sets them back to survival.
Hope this helped, reply if you need me to clear anything up.
This is what I thought to do but only really works if there’s 1player in area as it would keep detecting 1 in area and not turn off
I've done this exact thing. Set up a simple hopper clock, just 2 hoppers facing into each other. Take a signal from each. From one comparator (point to a solid block with impulse next to it if you want the chains next to each other) put the following:
Impulse
Execute @a ~ ~ ~ scoreboard players set @s adv 0
Chain
Execute @a[x=, y=, z=, dx=, dy=, dz=] ~ ~ ~ scoreboard players set @s adv 1
Now from the second comparator
Impulse
gamemode a @a[scores={adv=1},m=s]
Chain unconditional
gamemode s @a[scores={adv=0}, m=a]
Note that the whole thing could be done in a single chain, but using the hopper clock allows you to easily add adventure areas later by simply adding to the first chain. If you do it all in one then the gamemode setting commands have to be moved every time you add a new location, because they have to execute after all the scoreboard changes.
This method will work with multiple players, is not broken by lag, allows for a new area added with a single additional command block, and can even manage complicated decisions like nested zones (survival zone inside adventure zone inside survival zone).
I love this idea but I have one question. Understand I'm still pretty new to using command blocks and setting regions so forgive me if this is a dumb question. I haven't tried it yet either but here goes. Now, if I understand this right inside the defined zone all players are being changed to adventure mode and 1 block outside of that defined zone all players will be receiving the survival mode command. But what if you have certain players also in that outside area who are working in creative mode or you yourself wish to change your gamemode to creative? Will the hopper clock not continually over ride this and set everyone into survival mode? Is there a work around for this scenario that does not involve giving everyone creative mode or placing everyone in survival mode?
Ask me about our Bedrock Minecraft Realm - New Caledonia and our Java MCMMORPG Server Hy-Brasil.
http://hbmc.primalaspects.com
It only changes players from survival to adventure or back, it won't affect players in creative. You can also create a separate scoreboard objective to define players that it shouldn't affect at all, and include that in the second set of commands.
For example
gamemode s @a[scores={adv=0, fixedmode=0}]
Now you can set a repeating block that does
scoreboard players add @a fixedmode 0
Anyone logging in will have the objective added of it isn't already, everyone else will have 0 added to their existing score. Anyone you want controlling their own mode or otherwise not being changed by the automatic system you give a score of fixedmode 1.
Oh nice! Thank you very much!
Ask me about our Bedrock Minecraft Realm - New Caledonia and our Java MCMMORPG Server Hy-Brasil.
http://hbmc.primalaspects.com