It actually is possible to make a player be killed if off-screen. However, I see no reason why you couldn't just blockade the map with barriers.
You could use two tags, dx/dy/dz or radius.
If the map is single-player, then you can run the following command with a comparator runing off the command block.
/testfor @a[x,y,z,dx=?,dy=?,dz=?]
replace the x,y,z with the coordinates you want. Replace the ? next to dx with the x distance you want the player to be affected by.
Replace the ? next to dy with the y distance you want the player to be affected by.
Replace the ? next to dz with the dz distance you want the player to be affected by.
After that, you can invert the signal given off by a comparator that is connected to the command block so that it will kill all players if they are not in that radius.
I'm trying to make a Crossy Road sort of map and I'm making it so that if your character is off screen then the game ends.
You can't! Unless... you can't! .
You can place pressure plates that /kill the player and at the end you can leave trip wire to tp the player to the spawn.
You actually totally can't unless... ☺ .
It actually is possible to make a player be killed if off-screen. However, I see no reason why you couldn't just blockade the map with barriers.
You could use two tags, dx/dy/dz or radius.
If the map is single-player, then you can run the following command with a comparator runing off the command block.
/testfor @a[x,y,z,dx=?,dy=?,dz=?]
replace the x,y,z with the coordinates you want. Replace the ? next to dx with the x distance you want the player to be affected by.
Replace the ? next to dy with the y distance you want the player to be affected by.
Replace the ? next to dz with the dz distance you want the player to be affected by.
After that, you can invert the signal given off by a comparator that is connected to the command block so that it will kill all players if they are not in that radius.
Check my Twitter here for absolutely nothing.
AH barriers! Thank you so much i completely forgot about those. This makes things so much simpler.
you can also testfor a player for your boundary and have it /tp the player all the way down as far as you can go.
then the player will be surrounded by black. and it will appear kinda like as if you went into a blank/out of bounds area and died.
whats neat is the blackness can also kill you in creative.
so its extra deadly.