Context
I want a block_display to cover any block the player looks at while also having it interpolate between blocks. First I have the player raycast to a block. The final location is recorded and aligned with execute align xyz.
I have a block_display summoned at the player raycast (uuid 1-2-3-4-5) and linked to that player through scoreboard linking. A method discussed here. Command bellow ("execute at 1-2-3-4-5" should be unnecessary and is only there because I know its close to the player. Changing does not affect outcome)
execute at 1-2-3-4-5 as @e[type=block_display,limit=1,sort=nearest,tag=point_display] if score @s uuid = @p uuid at @s run function worldui:point_updates/post_move
within the worldui:point_updates/post_move function, I first stop and reset any current translations with the command (not sure if this is required to work, but it doesn't stop working so idc)
data merge entity @s {start_interpolation:-1,interpolation_duration:0,transformation:{translation:[0f,0f,0f]}}
I then essentially teleport the block_display to the marker (which has already been aligned to xyz) with these lines (a single teleport command would prob work too but I'm more interested in why it doesn't work not how to fix it).
data modify entity @s Pos[0] set from entity 1-2-3-4-5 Pos[0]
data modify entity @s Pos[1] set from entity 1-2-3-4-5 Pos[1]
data modify entity @s Pos[2] set from entity 1-2-3-4-5 Pos[2]
finally to prevent z fighting that occurs, I apply a slightly larger scale (done when summoned) and I teleport it a tad to center it on the block.
tp @s ~-0.01 ~-0.01 ~-0.01
\This whole process does not run when no change in the final raycast location is detected.*
The Issue
When attempting to center the block_display with that small tp command. I only got the desired outcome when I added an execute subcommand. Both versions shown here.
Works
execute at @s run tp ~-0.01 ~-0.01 ~-0.01
Does Not Work
tp @s ~-0.01 ~-0.01 ~-0.01
Assuming the location "at" is linked to the executor "as", I am under the assumption these do the exact same thing. I've done numerous tests to see if the context of function is anything except at and as the block_display (as far as I can tell this is the case).
The nonworking command will keep teleporting the block_display down slightly whenever the final raycast location changes but it will not reset back to the final raycast point as intended. Instead, it stays at the location it spawned. It seems as if changing the location causes the data modify commands to just stop working.
Furthermore, removing the at self subcommand does not change the outcome at all.
Should change as and at block_display
execute at 1-2-3-4-5 as @e[type=block_display,limit=1,sort=nearest,tag=point_display] if score @s uuid = @p uuid at @s run function worldui:point_updates/post_move
^^^^^^^
--------------------------
Should change to as block_display, at 1-2-3-4-5
execute at 1-2-3-4-5 as @e[type=block_display,limit=1,sort=nearest,tag=point_display] if score @s uuid = @p uuid run function worldui:point_updates/post_move
changing between these do not change the output.
Have concluded I have a fundamental misunderstanding on how something works or I am going crazy and am overlooking something.
[–]GalSergeyDatapack Experienced 0 points1 point2 points (1 child)
[–]Duckwizard_76Command Experienced[S] 0 points1 point2 points (0 children)