TransWikia.com

Minecraft 1.14.4 Teleport in multiplayer mode a different player relitive to them selfs from (Datapack) function called from command block

Arqade Asked by Jeffrey Ice on July 16, 2021

I’m cloning blocks in the x direction -1 at a time. I want to keep all players on these blocks with them so I teleport the player -1 relative to their current Pos[0] or X.

This works for me when the function is run from a repeating command block calling a datapack function as follows.

clone ~-9 ~-1 ~-2 ~63 ~5 ~2 ~-10 ~-1 ~-2 replace force

execute at @p run tp @p ~-1 ~ ~ 

As I’m executing the command @p

However this will not work for others. I do have a scoreboard to tell if a player is on the blocks so I can execute another function based on that scoreboard from this function. However I have tried multiple combos to get the other players in multiplayer mode to move -1 block in the x direction to no avail but I do move.

One Answer

To clarify what @Fabian Röling meant, the reason your commands do not work is because you are using the @p selector instead of the @a selector. Your command, execute at @p run to @p ~-1 ~ ~, means run this command at the nearest player and teleport the nearest player to that position -1 blocks in the x direction.

What you really want is

execute as @a at @s run tp @s ~-1 ~ ~

which means run this command as all players, respecting each of their positions, and teleport each of them relative to their position -1 blocks in the x direction.

If this isn't what you want, I recommend clarifying your question.

Answered by Zach K on July 16, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP