Ticking/load function files that use y and dy do not properly run.
Command in functions
Keep in note that this issue only affects functions that are running via tick.json or load.json
tellraw @a[y=-64,dy=319] {"text":"WORKED"}
Steps to Reproduce:
1. Download the example datapack below.
2. Install the example datapack in any world.
3. Run /reload to reload the data pack.
4. Manually run the function with the command using /function dp:run
Observed Results:
main_tick and main_load functions do not run the command with y and dy
Manually running the function works.
Expected Results:
main_tick and main_load will work the same as manually running the command.
You have a misunderstanding of selector arguments. I'll try to explain.
Every command has a position. Selectors search for entities from that position by default, but you can change the position with
x
,y
, andz
.Of course, the position is rather meaningless unless the region is bounded somehow.
distance
can do that, and so candx
/dy
/dz
. If you include one of those three, the others will be implicitly included as well. So@a[x=10,y=10,z=10,dx=5]
selects players from (10,10,10) to (15,10,10).So then, your command specifies only
y
anddy
. Therefore, the command search position will be where it originally was, withy
moved elsewhere, anddx
anddz
will be zero, creating a one block-wide column in which entities can be found.Where is the original search position? From chat, it's your position. From the server (e.g.
tick.json
functions), it's world spawn. Therefore, the command works perfectly as intended; from chat, it selects players at your horizontal position, between Y=-64 and Y=255. From the server, it selects players at world spawn, between Y=-64 and Y=255.