When using the tp command through a command block, @p is not teleporting the nearest player. It instead teleports the other player on the server.
I can't do any further testing since there are only two players currently on my server.
Comments 5
This command is running on a command block when a button is pressed. When I am the only one logged in, it works fine. Once my friend logged in, when I pushed the button, he was the one teleported. He was at least 50 blocks away at the time.
/execute in the_nether run tp @p 556 59 283
By using execute in, the command position is changed based on dimension scaling (1/8th in case of the nether), meaning a command at 80 8 80 is going to run at 10 8 10, and use that position as selector origin. That's by design, and you have to account for that.
Use this: /execute as @p in the_nether run tp @s 557 59 283
; this selects the nearest entity BEFORE scaling coordinates.
/execute is made so all options can be after each other; and they are processed left to right:/execute as @a if entity @s[distance=..1] at @s run say hi
has a different behavior from /execute as @a at @s if entity @s[distance=..1] run say hi
(as everyone if they are within 1 block of the execution location move the execution location to them VS as everyone at their location if they are within 1 block)
Please provide the full command used. @p works fine in commands for me.