Hey I want to do swimming system on my multiplayer server, when u reach the wall (it could be just block before the wall), it gives u 50 points (in specified scoreboard) and if you reach specified number of points, it should teleport player to specific coordinates. The main problem is I want it to work on multiplayer without a separate mechanism for each track. Tysm for ur help!
So let's assume that bottom left is 0 17 0 and top right is 10 17 10 (coordinates)
First chain of 3 :
execute positioned 0 17 0 as @a[dx=0,dy=0,dz=10,tag=!pool_bottom] run scoreboard players add @s pool_points 50
execute positioned 0 17 0 as @a[dx=0,dy=0,dz=10,tag=!pool_bottom] run tag @s add pool_bottom
execute positioned 0 17 0 as @a[dx=0,dy=0,dz=10] run tag @s remove pool_top
Second chain of 3 :
execute positioned 10 17 0 as @a[dx=0,dy=0,dz=10,tag=!pool_top] run scoreboard players add @s pool_points 50
execute positioned 10 17 0 as @a[dx=0,dy=0,dz=10,tag=!pool_top] run tag @s add pool_top
execute positioned 10 17 0 as @a[dx=0,dy=0,dz=10] run tag @s remove pool_bottom
chain of 2 :
tp @a[scores={pool_points=200},tag=!pool_finished] 200 17 200
tag @a[scores={pool_points=200},tag=!pool_finished] add pool_finished
What does it do ?
You check if the player reached the top bottom of the pool. If yes, it add 50 points, then add the tag pool_top. With the tag, the player can't have points anymore if he reach the top. It then remove the tag pool_bottom, which means that your player can now gain point when he reach the bottom.
It does the same for the bottom of the pool, but inversed, it add pool_bottom tag and remove pool_top.
The chain of 3 command blocks has to be : "repeat unconditionnal always active" for the first, and the two others "chain conditional always active"
The chain of two command block is when the player reach 200 points. It tp the player and add him the tag pool_finished.
The first one has to be "repeat unconditional always active" and the second "chain conditional always active"
How does it know when a player reach the bottom or top line? It's thanks to dx dy and dz, when you specify "positioned 10 17 0 as @a[dx=0,dy=0,dz=10]", only players on the line 10 17 0 to 10 17 10 are concerned.
Hey I want to do swimming system on my multiplayer server, when u reach the wall (it could be just block before the wall), it gives u 50 points (in specified scoreboard) and if you reach specified number of points, it should teleport player to specific coordinates. The main problem is I want it to work on multiplayer without a separate mechanism for each track. Tysm for ur help!
Hey
So let's assume that bottom left is 0 17 0 and top right is 10 17 10 (coordinates)
What does it do ?
You check if the player reached the top bottom of the pool. If yes, it add 50 points, then add the tag pool_top. With the tag, the player can't have points anymore if he reach the top. It then remove the tag pool_bottom, which means that your player can now gain point when he reach the bottom.
It does the same for the bottom of the pool, but inversed, it add pool_bottom tag and remove pool_top.
The chain of 3 command blocks has to be : "repeat unconditionnal always active" for the first, and the two others "chain conditional always active"
The chain of two command block is when the player reach 200 points. It tp the player and add him the tag pool_finished.
The first one has to be "repeat unconditional always active" and the second "chain conditional always active"
How does it know when a player reach the bottom or top line? It's thanks to dx dy and dz, when you specify "positioned 10 17 0 as @a[dx=0,dy=0,dz=10]", only players on the line 10 17 0 to 10 17 10 are concerned.
Feel free to ask if you have questions
I like trains... OF CHAIN COMMAND BLOCKS !