Minecraft – Command block doesn’t see radius on teleport

minecraft-commandsminecraft-java-edition

I am using two commands via command block:-

scoreboard teams join No-PVP @p[3743,70,3954,32,team=!No-PVP]
scoreboard teams join PVP @p[3743,70,3954,100,rm=36,team=!PVP]

Now, these commands work fine when you enter and leave the radius specified… but when you're inside the radius and teleport away from it, you don't seem to leave the team. It looks as if the command block isn't seeing that I have moved. What is causing this and how can I fix it?

Best Answer

The issue lies with the second command:

scoreboard teams join PVP @p[3743,70,3954,100,rm=36,team=!PVP]

Using 4 arguments without their keywords makes the game read them as x, y, z, and r. Your players are only assigned to the PVP team when they are between 36 and 100 blocks away from the specified coordinates. If they teleport farther away, the command does not apply to them.

The solution is to simply remove 100, from the command to disable the upper limit.