Testing for players within a specified rectangular area
I'm trying to set up a pvp arena and need a command block to test for players within a specified set of coordinates. I need to take a rectangular area so please don't reply with /testfor @p[x=,y=,z=,r=]
I saw one thing about using [x,y,z,dx,dy,dz] but I couldn't get it to work, and as I've never used the (dx,dy,dz) before, I don't know if I input them correctly.
Best Answer
The delta parameters (dx, dy, dz) state the number of blocks from the origin (x, y, z) to the opposite corner of the rectangular area, rather than a second set of coordinates.
For example, the following looks for players with the first corner at (100, 64, 100) to the opposite corner at (105, 70, 105):
/testfor @a[100,64,100,dx=5,dy=6,dz=5]
Pictures about "Testing for players within a specified rectangular area"



How do you test a player in Minecraft in a certain area?
2. Type the CommandArbitrary Rectangle Collision Detection \u0026 Resolution - Complete!
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: sergio souza, Zamaie Chinye, Erik Mclean, Skyler Ewing
