I like to make adventure maps, and have become reasonably adept at using command blocks in combination with redstone. Because this is my focus, I'm lovin' the new snapshot. One thing I can't figure out how to do, however, is to check for players that have passed a certain z coordinate, or how to take those players and change their game mode. I know how to do this for a radius from a single point, but I'm looking to test for a single dimension. Is this possible?
I like to make adventure maps, and have become reasonably adept at using command blocks in combination with redstone. Because this is my focus, I'm lovin' the new snapshot. One thing I can't figure out how to do, however, is to check for players that have passed a certain z coordinate, or how to take those players and change their game mode. I know how to do this for a radius from a single point, but I'm looking to test for a single dimension. Is this possible?
This is somewhat possible. You are still limited to defining a specific area, though you can make it as large as the playable world. For example, selecting any players that happen to walk anyhere in the world within the X coordinate of 42:
Tried putting this (gamemode adventure @a[player_z>353]) into a command block, but it didn't work. I don't know what the syntax is to get the player's z coordinate, but just putting in Z seems to be the Z access of the actual command block, which doesn't help in this case.
This is somewhat possible. You are still limited to defining a specific area, though you can make it as large as the playable world. For example, selecting any players that happen to walk anyhere in the world within the X coordinate of 42:
Alright, that seems like it's a step in the right direction, but I modified it (gamemode adventure @a[x=-30000000,y=0,z=365,dx=30000000,dy=256,dz=30000000]) to set any player past a certain z value to adventure mode, which is what I was trying to do. When I activate the command block, however, the button I use freezes in place and nothing happens.
Alright, that seems like it's a step in the right direction, but I modified it (gamemode adventure @a[x=-30000000,y=0,z=365,dx=30000000,dy=256,dz=30000000]) to set any player past a certain z value to adventure mode, which is what I was trying to do. When I activate the command block, however, the button I use freezes in place and nothing happens.
What you've done is set the dimensions to the entire world, which has now set your world into a lag spiral. If you want to test for a specific boundary without using radius, then you will need four of your /gamemode commands; the example I used displays the correct format, in which the axis you are not specifically testing for needs to be set to the maximum it can be (30,000,000 in both directions). The delta-x/y/z does not support negative values currently.
As well, the delta-coordinates do not support selecting players from that point and infinitely onward like with 'radius minimum' (rm).
But for example, changing gamemodes for players that walk along the X and Z axis of 42, -42:
What you've done is set the dimensions to the entire world, which has now set your world into a lag spiral. If you want to test for a specific boundary without using radius, then you will need four of your /gamemode commands; the example I used displays the correct format, in which the axis you are not specifically testing for needs to be set to the maximum it can be (30,000,000 in both directions). The delta-x/y/z does not support negative values currently.
As well, the delta-coordinates do not support selecting players from that point and infinitely onward like with 'radius minimum' (rm).
But for example, changing gamemodes for players that walk along the X and Z axis of 42, -42:
So it may be worthwhile just sticking to an 'rm' parameter.
I'm not sure I understand your example. So is there no way to simply test for a player's z value and change the gamemode of anyone who's walked past 365? That would be ideal, but if that's simply not doable currently, I could use the radius minimum function. Thanks for the help!
I'm not sure I understand your example. So is there no way to simply test for a player's z value and change the gamemode of anyone who's walked past 365? That would be ideal, but if that's simply not doable currently, I could use the radius minimum function. Thanks for the help!
It's a bit difficult to clarify. What the command is doing is checking for players between anywhere on the Z axis, and anywhere on the Y axis. Then the X axis is set to 42, which constrains the final bounding box to a single line, like so (looking from above, the red line represents the X axis of 42, and 30,000,000 in either direction):
You can adjust it to select players anywhere at X:42 and beyond, but it will cause a large amount of server lag as you have experienced. So your best option would still be to use a radius minimum, yes.
This is somewhat possible. You are still limited to defining a specific area, though you can make it as large as the playable world. For example, selecting any players that happen to walk anyhere in the world within the X coordinate of 42:
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
Alright, that seems like it's a step in the right direction, but I modified it (gamemode adventure @a[x=-30000000,y=0,z=365,dx=30000000,dy=256,dz=30000000]) to set any player past a certain z value to adventure mode, which is what I was trying to do. When I activate the command block, however, the button I use freezes in place and nothing happens.
What you've done is set the dimensions to the entire world, which has now set your world into a lag spiral. If you want to test for a specific boundary without using radius, then you will need four of your /gamemode commands; the example I used displays the correct format, in which the axis you are not specifically testing for needs to be set to the maximum it can be (30,000,000 in both directions). The delta-x/y/z does not support negative values currently.
As well, the delta-coordinates do not support selecting players from that point and infinitely onward like with 'radius minimum' (rm).
But for example, changing gamemodes for players that walk along the X and Z axis of 42, -42:
So it may be worthwhile just sticking to an 'rm' parameter.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
I'm not sure I understand your example. So is there no way to simply test for a player's z value and change the gamemode of anyone who's walked past 365? That would be ideal, but if that's simply not doable currently, I could use the radius minimum function. Thanks for the help!
It's a bit difficult to clarify. What the command is doing is checking for players between anywhere on the Z axis, and anywhere on the Y axis. Then the X axis is set to 42, which constrains the final bounding box to a single line, like so (looking from above, the red line represents the X axis of 42, and 30,000,000 in either direction):
You can adjust it to select players anywhere at X:42 and beyond, but it will cause a large amount of server lag as you have experienced. So your best option would still be to use a radius minimum, yes.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/