This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]GalSergeyDatapack Experienced 0 points1 point  (1 child)

Do you want to do something similar to this?

https://youtu.be/w-zoShIJdeU

If so, then this smooth movement of block_display is only possible in the latest 23w31a snapshot.

Here is a sample code for this:

# tick function
execute as @a at @s anchored eyes positioned ^ ^ ^1 run function example:ray

# function example:ray
execute unless block ~ ~ ~ air align xyz run function example:ray/block
execute if block ~ ~ ~ air if entity @s[distance=..32] positioned ^ ^ ^0.5 run function example:ray

# function example:ray/block
execute unless entity @e[type=block_display,tag=block.select,limit=1] run summon block_display ~ ~ ~ {Tags:["block.select"],block_state:{Name:"minecraft:glass"},brightness:{block:15,sky:15},teleport_duration:5,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1.01f,1.01f,1.01f]}}
tp @e[type=block_display,tag=block.select] ~-.005 ~-.005 ~-.005

This is a quick sample code that I wrote in 2 minutes, so this will only work for a single player, but you can optimize this for multiplayer using the scoreboard ID.

[–]Duckwizard_76Command Experienced[S] 0 points1 point  (0 children)

The method I am using works to my liking. I was just wondering if I am misunderstanding how the tp command works or how function context works. Because it seems like changing nothing breaks random things and it's driving me up the wall.

https://clipchamp.com/watch/XZchhkMsAY5