0

I'm making a dead by daylight map in Minecraft: Bedrock Edition and I was wondering if there is a way to test if a player in a certain area has a certain score because I made vaulting with /tp @p[scores{alive=1}] ~ ~ ~ so I want to make it so only survivors who have alive 1 can do generators

2 Answers 2

1

You can use the volume selector and scores selector

I am a java player but the volume selector's format should be very similar (x=,dx=,y=,dy=,z=,dz=).

x=,y=,z= refer to the starting coordinate of the block region, while dx=,dy=,dz= embodies the displacment of the coordinates required to draw a volume. #note that dx dy and dz is not the end point coordinates, the end point coordinates should be (x+dx,y+dy,z+dz)

Suppose the "certain area" you are referring to is a box area of 10 meters side length at the spawn point (x=0,y=0,z=0)

execute as @a[x=0,dx=10,y=0,dy=10,z=0,dz=10,scores={Alive:1}] run *insert code* This would run the inserted code for players meeting both requirements --- within the block region and have the score {Alive:1}

An alternative option: Set an marker entity or armor stand at your "certain area" and execute as @e[type=marker,tag=area_marker] at @s run execute as @a[r=10,scores={Alive:1}] at @s run *insert code* Allows you to run the command without specifying coordinates which is convenient for mulitple placements.

-1

So for you to sense if someone is in a certain area , you can use volume selectors, dx, dy, and dz. The selected volume would be the space from x, y, and z to x+dx, y+dy, and z+dz. For example:

/give @a[x=1, y=2, z=3, dx=2, dy=2, dz=2] cake

This give anyone between 1 2 3 and 3 4 5 a cake

For the score selector, you almost did it, but not quite. The only thing you had to change is put an equal sign(=) between the scores and the {Alive=1}.

I can't really say the final command because I don't know your space which your testing players for.

1
  • 2 things. 1: Your answer doesn't provide any new information. 2: Your statement "This give anyone between 1 2 3 and 3 4 5 a cake." is both incorrect and unclear. You don't specify X Y or Z with these numbers. Also, if you meant X and Z this is incorrect as it would only affect players in Y 2-4.
    – AdamRaichu
    Feb 3, 2022 at 15:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .