I'm trying to make it so that a specific player who enters a region, anywhere between 730, 0, 110 and 760, 256, 137, gets teleported to spawn. I managed to make it so whenever anyone entered the area it would teleport the target player to spawn, but my main goal is to make it so that I can walk around freely while my friend is locked out without having him teleported to spawn 10 times every second. I tried using teams but that wouldn't work either, but maybe I'm just doing it wrong.
I've been using this command, goawayree
being the team I created with the target in it.
execute if entity @a[team=goawayree][x=730,y=0,z=110,dx=50,dy=256,dz=50] run tp @a[team=goawayree] 0 72 0
this was using radius' as i couldnt figure out how i would make a set boundary without 300 armor stands and 13 different headaches.
if this isnt possible please please please point out a similar way to do this, ive been looking for solutions online for about 3 days.
thanks for the help in advance
Best Answer
With selectors, all filters(or the values in the square brackets) go in one array(square brackets). It would be in the form of
name=value,name=value,name=value
and it keeps going until you don't have any other filters to add. So you need to combineteam=goawayree
withx=730,y=0,z=110,dx=50,dy=256,dz=50
in one array to make[team=goawayree, x=730,y=0,z=110,dx=50,dy=256,dz=50]
. You also are teleporting everyone on thegoawayree
team, when any player is in the rectangular prismx=730,y=0,z=110,dx=50,dy=256,dz=50
. You can fix this by using just atp
command, selecting everyone ongoawayree
team in the rectangular prism, and tping them to spawn. Here is how you do that.That command in theory should work. If you have any problems let me know.