#Command coords x y z dx dy and dz are broken?
1 messages ยท Page 1 of 1 (latest)
probably because of player hitbox and how the game calculates player position for the display
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.
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.
That's why sprunkles suggesting to add 0.3 block from the detection.
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 ๐
is that a bug or not?
It worked before and has been that way since the update
Not a bug!
worst feature ever
I think if you use โrโ in there instead of checking hotbox. it will work perfectly
Use -47.7,50,-63.7 then!
uff i have to change that for every command ... i dont understand why did they changed that?
Just bear it ๐คฃ
not funny
This thing is logicaly correct so no need to blame on it . ๐ฃ
/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
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
It works this way in Java Edition, and has in Bedrock since 1.19.70.
sorry to anoy u again but how do i detect the player on the right y coords
/execute as @s[y=72,dy=0] at @s run msg TeeWhiteBlack jds
i want the player ont the exact y coord 72 not 71 not 71.5 not 73 only 72-72.99
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?
Feet part only!
yes
@a[y=72,dy=0] unless entity @s[y=71,dy=0]
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
Do you getting the result?
yes
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
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
nah i only want that with x coord
if the player is at -1 x it should run the code
X and Z are same here
/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
x=-1.7,....x=-0.7
Work on x=-2
nope that isnt right
x=1.3,....x=2.3
Work on x=1
if iam at the corner middle it doesnt work
Then there is a bug i think
i mean if i use tp at the bottom it shows this /tp -0.02 53.00 0.44
I didn't check that so I can't really say what you want to do in there
but coords show -1 52 0
just checking if the players is at the coords yes or not thats all
I will be back after checking the cmd then
ok thx
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 ...
This is for x=0 block test
First removing hitbox when you are in x=-1 [ using if ] then need another condition to remove hitbox when you are in x=1 [using unless]
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
i dont need z coords only checking if the player is in any x=-1
/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
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