I'm trying to make an execute command (since they removed /testfor) where when a player stands on a certain block, they get teleported to the next story in the house. (stairs are overrated) If the test is passed, the player gets teleported. Although, the test seems to pass even when I'm not standing at that specific block. Here is the command:
/execute if entity @p[x=-421,y=5,z=124] run tp @p ~ ~6 ~
The command block is set on Repeat, Unconditional, and Always Active.
If this is for singleplayer world, it should be fine. If not, the first @p and the last @p doesn't mean the same player, which might cause issue. Therefore, use @s to make the target consistent.
/execute as @a[x=-421,y=5,z=124,dx=0,dy=0,dz=0] at @s run teleport @s ~ ~6 ~
That sounds like a specific area rather than a specific block. These two are not the same.
In case you are wondering the other one.
/execute as @a at @s if block ~ ~-0.1 ~ minecraft:diamond_block run teleport @s ~ ~6 ~
I'm trying to make an execute command (since they removed /testfor) where when a player stands on a certain block, they get teleported to the next story in the house. (stairs are overrated) If the test is passed, the player gets teleported. Although, the test seems to pass even when I'm not standing at that specific block. Here is the command:
/execute if entity @p[x=-421,y=5,z=124] run tp @p ~ ~6 ~
The command block is set on Repeat, Unconditional, and Always Active.
Thanks in advance
If this is for singleplayer world, it should be fine. If not, the first @p and the last @p doesn't mean the same player, which might cause issue. Therefore, use @s to make the target consistent.
That sounds like a specific area rather than a specific block. These two are not the same.
In case you are wondering the other one.
Ok, that worked.
Thanks