#Command coords x y z dx dy and dz are broken?

1 messages ยท Page 1 of 1 (latest)

wooden thistle
#

/execute at @s[x=-48,dx=50,y=-64,dy=382,z=-2043,dz=50] run say hi

#

why?

#

Why are coordinates shifted by 1?

pulsar karma
#

probably because of player hitbox and how the game calculates player position for the display

snow dome
#

As mittens said, it's the player hitbox. dx dy dz does not select by position, so the selection box is effectively widened by 0.3 blocks.

#

Think of it this way: If you placed a block at (-48, 66, -2043) and stood beside it, you would not be selected, since the player's hitbox is not intersecting that block. While you stand beside the block, you are more than 0.3 blocks away from the selection. Remove the block and stand partially inside it, then you will be selected.

frigid heart
frigid heart
# frigid heart

Just a pictorial representation ๐Ÿ˜…
Your standing on -1,y,-1 and you are trying to detect any entity on the block 0,y,0 and it will trigger even if your not in 0,0 . Because your hotbox it touching that detection region.

frigid heart
#

That way if you standing on corner of the -1,-1 [towards 0,0] it only detect if that hit box is on 0.3,0.3

#

Sorry if there is any grammar/spelling mistake.

#

Happy new year ๐ŸŽŠ

frigid heart
#

Hmm I think i write wrong coordinates there ๐Ÿคฆ

wooden thistle
#

It worked before and has been that way since the update

frigid heart
wooden thistle
#

worst feature ever

frigid heart
#

I think if you use โ€rโ€ in there instead of checking hotbox. it will work perfectly

wooden thistle
#

i cant

#

is a square

frigid heart
#

Use -47.7,50,-63.7 then!

wooden thistle
#

uff i have to change that for every command ... i dont understand why did they changed that?

wooden thistle
#

not funny

frigid heart
#

This thing is logicaly correct so no need to blame on it . ๐Ÿฃ

wooden thistle
#

/execute at @s[x=-47.7,dx=50,y=-63.7,dy=382,z=-2043,dz=50 and this would work perfect=?

#

it will work from 48 until +50 so =98

frigid heart
#

You can test it in an easy way. Using
/tp 0 0 0 will tp you to that block's center 0.5,0.5,0.5
If you use /tp 0.00,0.00,0.00 it will tp you exactly that point
Idk this is related to your question

wooden thistle
#

so the command should stops at x coords 3

#

i test that later

snow dome
wooden thistle
frigid heart
#

When you are in block 72 then the hitblox is in 72 also is in 73 because player hitbox is 1.8 block higher.[or 72 and 71]
If you want to detect exactly on the block 72 then another condition need to perform.

Hmm which part do you want to detect when you on the block?

wooden thistle
#

hmm the bottom

#

like the feet

frigid heart
#

Feet part only!

wooden thistle
#

yes

frigid heart
#

@a[y=72,dy=0] unless entity @s[y=71,dy=0]

wooden thistle
#

it execute the command on x=70 and says no target matched

#

i got it , /execute at @s[y=73,dy=0] unless entity @s[y=74,dy=0] run msg TeeWhiteBlack jds

#

this is so anoying

wooden thistle
#

thx

#

but now i need that for x and z coords

#

i dont get the result i want

#

ok got it for x-2

#

/execute as @s[x=-1.7,dx=0] at @s unless entity @s[x=-0.7,dx=0] run say hi

#

only problem 0 and -1 doesnt work right

#

i give up i dont know how this shit works

frigid heart
#

For zero use x/z=0.3,dx/z=0
For -1 use x/z=-0.7,dx/z=0

#

@wooden thistle

#

I don't test it . Simply write on base of the logic!

#

What i doing is just adding 0.3 on that coord
Eg: for +ve number 1 -> 1.3 | 10 -> 10.3
For -ve number -1 -> -1+0.3 -> -0.7 | -10 -> -9.7

wooden thistle
#

nah i only want that with x coord

#

if the player is at -1 x it should run the code

frigid heart
wooden thistle
#

/execute as @s[x=-1.7,dx=0] at @s unless entity @s[x=-0.3,dx=0] run say hi

like this ?

#

this doesnt work

wooden thistle
#

yes

#

but what are the coords for -1 and 0

#

or only 1

frigid heart
#

x=-0.7,....x=0.3
Work on x=-1

#

x=0.3,...x=1.3
Work on x=0

wooden thistle
frigid heart
#

x=1.3,....x=2.3
Work on x=1

wooden thistle
#

if iam at the corner middle it doesnt work

frigid heart
wooden thistle
#

i mean if i use tp at the bottom it shows this /tp -0.02 53.00 0.44

frigid heart
#

I didn't check that so I can't really say what you want to do in there

wooden thistle
#

but coords show -1 52 0

wooden thistle
frigid heart
wooden thistle
frigid heart
#

Sorry for the delay.

#

I tested the thing and forgot one thing that we only offset one side of the block according to player hitbox. Need to add another condition there for offset opposite side also ๐Ÿคฃ

#

/execute as @a at @s if entity @s[x=0.3,dx=0] unless entity @s[x=1.3,dx=0] run ...

frigid heart
#

If you want to add x , z in a cmd then you want to add unless-seperate,if in same position.

#

Eg- /execute as @a at @s if entity @s[x=-0.7,dx=0.z=0.3,dz=0] unless entity @s[x=0.3,dx=0] unless entity @s[z=1.3,dz=0] run...

#

For testing player is in x=-1,z=0

#

Idk there is an easy way to do it or not. If so someone will info that in here ๐Ÿฃ

#

@wooden thistle

wooden thistle
frigid heart
#

/execute as @a at @s if entity @s[x=-0.7,dx=0] unless entity @s[x=0.3,dx=0] run ...

#

For x=-1

#

Check is that working or not

#

@wooden thistle

wooden thistle
#

ok does work now

thats mean for coords like 0 i use this
/execute as @a at @s if entity @s[x=0.3,dx=0] unless entity @s[x=1.3,dx=0] run
for -1
/execute as @a at @s if entity @s[x=-0.7,dx=0] unless entity @s[x=0.3,dx=0] run

and any other coords i use this
/execute as @s[x=-3.7,dx=0] at @s unless entity @s[x=-2.7,dx=0] run