mojira.dev
MC-119106

Boat with two passengers cannot teleport to where the latter at by using function/command block with looping.

As my imagination, this function would teleport the boat far away from player. The function works, but the boat only teleport once as if the function didn't work perfectly.
Here is the function.

execute @e[tag=back] ~ ~ ~ summon minecraft:armor_stand ~ ~ ~ {Tags:["temp"]}
tp @e[tag=temp] @e[tag=back]
tp @e[tag=l] @e[tag=temp]
kill @e[tag=temp]
(repeat more than once)

I want to do like this
link title
But I want to complete in one tick.

Attachments

Comments 2

Since you want the commands in the function to repeat multiple times per tick, I would suggest (with caution) that you call your function within itself, and add some control parameters to terminate the recursion chain when needed. Functions have a built in command limit and possibly a limit on function calls, meaning that the recursion should terminate on its own and prevent the game from freezing/crashing. I'm assuming that by "(repeat more than once)" and the fact that you want it to complete in one tick that your function has multiple summon, tp, and kill sections within it. By this assumption, I would say the issue is invalid because every command in the function is executed in the same tick, meaning that the player would only see the end result of the function, not all of the steps in between. Try running the function in a repeating command block, and remove the duplicate summon, tp, and kill commands from the function. This should give you the behavior you expected.

Is this still a issue in the latest version of the game(currently 1.13.1)?

If so, please add it to the affected versions, thanks!

jellywayne

(Unassigned)

Unconfirmed

Minecraft 1.12

Retrieved