Minecraft – Teleporting entity through command block teleports entity to command block and stops moving, even with execute as

minecraft-commandsminecraft-java-edition

I am using a repeating command block to repeatedly teleport a falling block with a custom tag called "Debris" 0.125 blocks on the negative z axis causes the falling block to teleport to the command block instead and not moving at all:

tp @e[type=falling_block,distance=..200,tag=Debris]

I decided to fix this by forcing the falling block to run the command itself, instead

execute as @e[type=minecraft:falling_block,distance=..200,tag=Debris] run tp @s ~ ~ ~-.125

and I still got the same result of the block being frozen to the command block instead. I'm not sure what I'm doing wrong here, I summoned a block with a custom tag called "Debris", then used a repeating command block to force the block to run the command itself, but it ends up acting like the repeating command block is running the teleport command instead of the block, which is supposed to be running the command because of the execute as.

Best Answer

/execute as does not change position, it changes the entity only. In your case, /execute as @e[type=falling_block], the falling block is the executor, but the position hasn't changed.

You need to add at @s in order to move the position to the executing entity. Like this:

execute as @e[...] at @s run ..