mojira.dev
MC-133744

dx,dy,dz inacurate

 

tp @e[x=-100,y=69,z=60,dx=230,dy=255,dz=200,type=minecraft:skeleton] ~ -200 ~

I wanted 100 blocks which would be 200 square spawn protection for my villagers and players so I made one for each type of hostile mob. My server spawn is x=0, z=160.

Apparently 230 blocks on the dx equates to 202 blocks linear on the x.

Mobs were still able to spawn (exist) within about 50 blocks of the center of the area. Specifically I only really tested that from x=0 to x=-50 around plus or minus 50 blocks of z=160. The code worked between somewhere around x=-50 all the way to x=-100. Testing in the positive x seemed to work fine.

Comments 9

dx dy dz are the difference over that axis

the "selection box" will be from x,y,z to x+dx,y+dy,z+dz.

Also note, that the command block containing the command (if there are any) have to be in loaded chunks, in order to run.

I do fully understand how the code is intended to work, im telling you it does not work the way intended.

x=-100 plus dx=200 should be x=100 but is actually x=72, check it.

To compensate I had to use x=230.
In addition, I found there were holes in the selection area which the server was overlooking on the negative x side of the selection area.

Works fine for me, the command block is likely getting into unloaded chunks.

Its my spawn, it doesn't unload and im standing in the chunk im testing. Its also not in a command block, its in a function.

In that case, this is a more proper resolution.

Again, it works fine for me,

execute as @a at @s run say @s[x=-100,dx=200]

makes me say my name when I'm between x=-100 to 200 just fine (and also can't reproduce the "holes" in the selection area).

I will provide my exact code for you to test.

That code is run in a function every 18 ticks.

-52 67 166 skeleton mob spawned manually by egg and does not get tp'd to the void.

Tested with your exact commands, and it properly selects x -100 to 130, y 69 to 324, z 50 to 260.

67 is BELOW the selection area.

dw, I appologize, I made an error with the y axis, I was still thinking expand from that area when I put the y in. I should have had y=0. I adjusted the x and z but forgot about the y.

Michael Hurt

(Unassigned)

Unconfirmed

Minecraft 1.13-pre9

Retrieved